ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/skills.C
(Generate patch)

Comparing deliantra/server/server/skills.C (file contents):
Revision 1.15 by root, Wed Dec 13 03:28:42 2006 UTC vs.
Revision 1.16 by root, Wed Dec 20 09:14:22 2006 UTC

292 /* If player can't move onto the space, can't steal from it. */ 292 /* If player can't move onto the space, can't steal from it. */
293 if (OB_TYPE_MOVE_BLOCK (op, GET_MAP_MOVE_BLOCK (m, x, y))) 293 if (OB_TYPE_MOVE_BLOCK (op, GET_MAP_MOVE_BLOCK (m, x, y)))
294 return 0; 294 return 0;
295 295
296 /* Find the topmost object at this spot */ 296 /* Find the topmost object at this spot */
297 for (tmp = get_map_ob (m, x, y); tmp != NULL && tmp->above != NULL; tmp = tmp->above); 297 for (tmp = GET_MAP_OB (m, x, y); tmp != NULL && tmp->above != NULL; tmp = tmp->above);
298 298
299 /* For all the stacked objects at this point, attempt a steal */ 299 /* For all the stacked objects at this point, attempt a steal */
300 for (; tmp != NULL; tmp = next) 300 for (; tmp != NULL; tmp = next)
301 { 301 {
302 next = tmp->below; 302 next = tmp->below;
383 { 383 {
384 new_draw_info (NDI_UNIQUE, 0, pl, "There is no lock there."); 384 new_draw_info (NDI_UNIQUE, 0, pl, "There is no lock there.");
385 return 0; 385 return 0;
386 } 386 }
387 387
388 for (tmp = get_map_ob (pl->map, x, y); tmp; tmp = tmp->above) 388 for (tmp = GET_MAP_OB (pl->map, x, y); tmp; tmp = tmp->above)
389 if (tmp->type == DOOR || tmp->type == LOCKED_DOOR) 389 if (tmp->type == DOOR || tmp->type == LOCKED_DOOR)
390 break; 390 break;
391 391
392 if (!tmp) 392 if (!tmp)
393 { 393 {
543 new_draw_info (NDI_UNIQUE, 0, pl, "Your jump is blocked."); 543 new_draw_info (NDI_UNIQUE, 0, pl, "Your jump is blocked.");
544 stop_jump (pl, i, spaces); 544 stop_jump (pl, i, spaces);
545 return 0; 545 return 0;
546 } 546 }
547 547
548 for (tmp = get_map_ob (m, x, y); tmp; tmp = tmp->above) 548 for (tmp = GET_MAP_OB (m, x, y); tmp; tmp = tmp->above)
549 { 549 {
550 /* Jump into creature */ 550 /* Jump into creature */
551 if (QUERY_FLAG (tmp, FLAG_MONSTER) || (tmp->type == PLAYER && (!QUERY_FLAG (tmp, FLAG_WIZ) || !tmp->contr->hidden))) 551 if (QUERY_FLAG (tmp, FLAG_MONSTER) || (tmp->type == PLAYER && (!QUERY_FLAG (tmp, FLAG_WIZ) || !tmp->contr->hidden)))
552 { 552 {
553 new_draw_info_format (NDI_UNIQUE, 0, pl, "You jump into %s%s.", tmp->type == PLAYER ? "" : "the ", &tmp->name); 553 new_draw_info_format (NDI_UNIQUE, 0, pl, "You jump into %s%s.", tmp->type == PLAYER ? "" : "the ", &tmp->name);
638 esrv_update_item (UPD_FLAGS, pl, tmp); 638 esrv_update_item (UPD_FLAGS, pl, tmp);
639 success += calc_skill_exp (pl, tmp, skill); 639 success += calc_skill_exp (pl, tmp, skill);
640 } 640 }
641 641
642 /* Check ground, too, but only objects the player could pick up */ 642 /* Check ground, too, but only objects the player could pick up */
643 for (tmp = get_map_ob (pl->map, pl->x, pl->y); tmp; tmp = tmp->above) 643 for (tmp = GET_MAP_OB (pl->map, pl->x, pl->y); tmp; tmp = tmp->above)
644 if (can_pick (pl, tmp) && 644 if (can_pick (pl, tmp) &&
645 !QUERY_FLAG (tmp, FLAG_IDENTIFIED) && 645 !QUERY_FLAG (tmp, FLAG_IDENTIFIED) &&
646 !QUERY_FLAG (tmp, FLAG_KNOWN_CURSED) 646 !QUERY_FLAG (tmp, FLAG_KNOWN_CURSED)
647 && (QUERY_FLAG (tmp, FLAG_CURSED) || QUERY_FLAG (tmp, FLAG_DAMNED)) && tmp->item_power < skill->level) 647 && (QUERY_FLAG (tmp, FLAG_CURSED) || QUERY_FLAG (tmp, FLAG_DAMNED)) && tmp->item_power < skill->level)
648 { 648 {
669 esrv_update_item (UPD_FLAGS, pl, tmp); 669 esrv_update_item (UPD_FLAGS, pl, tmp);
670 success += calc_skill_exp (pl, tmp, skill); 670 success += calc_skill_exp (pl, tmp, skill);
671 } 671 }
672 672
673 /* Check ground, too, but like above, only if the object can be picked up */ 673 /* Check ground, too, but like above, only if the object can be picked up */
674 for (tmp = get_map_ob (pl->map, pl->x, pl->y); tmp; tmp = tmp->above) 674 for (tmp = GET_MAP_OB (pl->map, pl->x, pl->y); tmp; tmp = tmp->above)
675 if (can_pick (pl, tmp) && 675 if (can_pick (pl, tmp) &&
676 !QUERY_FLAG (tmp, FLAG_IDENTIFIED) && !QUERY_FLAG (tmp, FLAG_KNOWN_MAGICAL) && (is_magical (tmp)) && tmp->item_power < skill->level) 676 !QUERY_FLAG (tmp, FLAG_IDENTIFIED) && !QUERY_FLAG (tmp, FLAG_KNOWN_MAGICAL) && (is_magical (tmp)) && tmp->item_power < skill->level)
677 { 677 {
678 SET_FLAG (tmp, FLAG_KNOWN_MAGICAL); 678 SET_FLAG (tmp, FLAG_KNOWN_MAGICAL);
679 esrv_update_item (UPD_FLAGS, pl, tmp); 679 esrv_update_item (UPD_FLAGS, pl, tmp);
734 734
735 for (tmp = pl->inv; tmp; tmp = tmp->below) 735 for (tmp = pl->inv; tmp; tmp = tmp->below)
736 success += do_skill_ident2 (tmp, pl, obj_class, skill); 736 success += do_skill_ident2 (tmp, pl, obj_class, skill);
737 /* check the ground */ 737 /* check the ground */
738 738
739 for (tmp = get_map_ob (pl->map, pl->x, pl->y); tmp; tmp = tmp->above) 739 for (tmp = GET_MAP_OB (pl->map, pl->x, pl->y); tmp; tmp = tmp->above)
740 success += do_skill_ident2 (tmp, pl, obj_class, skill); 740 success += do_skill_ident2 (tmp, pl, obj_class, skill);
741 741
742 return success; 742 return success;
743} 743}
744 744
838 { 838 {
839 new_draw_info (NDI_UNIQUE, 0, pl, "There is nothing to orate to."); 839 new_draw_info (NDI_UNIQUE, 0, pl, "There is nothing to orate to.");
840 return 0; 840 return 0;
841 } 841 }
842 842
843 for (tmp = get_map_ob (m, x, y); tmp; tmp = tmp->above) 843 for (tmp = GET_MAP_OB (m, x, y); tmp; tmp = tmp->above)
844 { 844 {
845 /* can't persuade players - return because there is nothing else 845 /* can't persuade players - return because there is nothing else
846 * on that space to charm. Same for multi space monsters and 846 * on that space to charm. Same for multi space monsters and
847 * special monsters - we don't allow them to be charmed, and there 847 * special monsters - we don't allow them to be charmed, and there
848 * is no reason to do further processing since they should be the 848 * is no reason to do further processing since they should be the
964 if (mflags & P_OUT_OF_MAP) 964 if (mflags & P_OUT_OF_MAP)
965 continue; 965 continue;
966 if (!(mflags & P_IS_ALIVE)) 966 if (!(mflags & P_IS_ALIVE))
967 continue; 967 continue;
968 968
969 for (tmp = get_map_ob (m, x, y); tmp; tmp = tmp->above) 969 for (tmp = GET_MAP_OB (m, x, y); tmp; tmp = tmp->above)
970 { 970 {
971 if (QUERY_FLAG (tmp, FLAG_MONSTER)) 971 if (QUERY_FLAG (tmp, FLAG_MONSTER))
972 break; 972 break;
973 /* can't affect players */ 973 /* can't affect players */
974 if (tmp->type == PLAYER) 974 if (tmp->type == PLAYER)
1034 mflags = get_map_flags (m, &m, x, y, &x, &y); 1034 mflags = get_map_flags (m, &m, x, y, &x, &y);
1035 if (mflags & P_OUT_OF_MAP) 1035 if (mflags & P_OUT_OF_MAP)
1036 continue; 1036 continue;
1037 1037
1038 /* Check everything in the square for trapness */ 1038 /* Check everything in the square for trapness */
1039 for (tmp = get_map_ob (m, x, y); tmp != NULL; tmp = tmp->above) 1039 for (tmp = GET_MAP_OB (m, x, y); tmp != NULL; tmp = tmp->above)
1040 { 1040 {
1041 1041
1042 /* And now we'd better do an inventory traversal of each 1042 /* And now we'd better do an inventory traversal of each
1043 * of these objects' inventory 1043 * of these objects' inventory
1044 * We can narrow this down a bit - no reason to search through 1044 * We can narrow this down a bit - no reason to search through
1097 mflags = get_map_flags (m, &m, x, y, &x, &y); 1097 mflags = get_map_flags (m, &m, x, y, &x, &y);
1098 if (mflags & P_OUT_OF_MAP) 1098 if (mflags & P_OUT_OF_MAP)
1099 continue; 1099 continue;
1100 1100
1101 /* Check everything in the square for trapness */ 1101 /* Check everything in the square for trapness */
1102 for (tmp = get_map_ob (m, x, y); tmp != NULL; tmp = tmp->above) 1102 for (tmp = GET_MAP_OB (m, x, y); tmp != NULL; tmp = tmp->above)
1103 { 1103 {
1104 /* And now we'd better do an inventory traversal of each 1104 /* And now we'd better do an inventory traversal of each
1105 * of these objects inventory. Like above, only 1105 * of these objects inventory. Like above, only
1106 * do this for interesting objects. 1106 * do this for interesting objects.
1107 */ 1107 */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines