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

Comparing deliantra/server/server/spell_attack.C (file contents):
Revision 1.20 by root, Mon Dec 18 02:35:01 2006 UTC vs.
Revision 1.21 by root, Wed Dec 20 09:14:22 2006 UTC

57 { 57 {
58 weight_move = op->weight + (op->weight * op->level) / 3; 58 weight_move = op->weight + (op->weight * op->level) / 3;
59 /*LOG (llevDebug, "DEBUG: arch weighs %d and masses %d (%s,level %d)\n", op->weight,weight_move,op->name,op->level); */ 59 /*LOG (llevDebug, "DEBUG: arch weighs %d and masses %d (%s,level %d)\n", op->weight,weight_move,op->name,op->level); */
60 } 60 }
61 61
62 for (tmp = get_map_ob (op->map, op->x, op->y); tmp != NULL; tmp = tmp->above) 62 for (tmp = GET_MAP_OB (op->map, op->x, op->y); tmp != NULL; tmp = tmp->above)
63 { 63 {
64 int num_sections = 1; 64 int num_sections = 1;
65 65
66 /* don't move DM */ 66 /* don't move DM */
67 if (QUERY_FLAG (tmp, FLAG_WIZ)) 67 if (QUERY_FLAG (tmp, FLAG_WIZ))
536 536
537 /* If nothing alive on this space, no reason to do anything further */ 537 /* If nothing alive on this space, no reason to do anything further */
538 if (!(mflags & P_IS_ALIVE)) 538 if (!(mflags & P_IS_ALIVE))
539 return; 539 return;
540 540
541 for (tmp = get_map_ob (op->map, op->x, op->y); tmp != NULL; tmp = tmp->above) 541 for (tmp = GET_MAP_OB (op->map, op->x, op->y); tmp != NULL; tmp = tmp->above)
542 { 542 {
543 if (QUERY_FLAG (tmp, FLAG_ALIVE)) 543 if (QUERY_FLAG (tmp, FLAG_ALIVE))
544 { 544 {
545 dam = hit_player (tmp, op->stats.dam, op, op->attacktype, 1); 545 dam = hit_player (tmp, op->stats.dam, op, op->attacktype, 1);
546 if (op->destroyed () || !tmp->destroyed () || (op->stats.dam -= dam) < 0) 546 if (op->destroyed () || !tmp->destroyed () || (op->stats.dam -= dam) < 0)
1123 if (GET_MAP_MOVE_BLOCK (mp, x, y) & MOVE_FLY_LOW) 1123 if (GET_MAP_MOVE_BLOCK (mp, x, y) & MOVE_FLY_LOW)
1124 return NULL; 1124 return NULL;
1125 1125
1126 if (mflags & P_IS_ALIVE) 1126 if (mflags & P_IS_ALIVE)
1127 { 1127 {
1128 for (target = get_map_ob (mp, x, y); target; target = target->above) 1128 for (target = GET_MAP_OB (mp, x, y); target; target = target->above)
1129 { 1129 {
1130 if (QUERY_FLAG (target->head ? target->head : target, FLAG_MONSTER)) 1130 if (QUERY_FLAG (target->head ? target->head : target, FLAG_MONSTER))
1131 { 1131 {
1132 return target; 1132 return target;
1133 } 1133 }
1397 mflags = get_map_flags (m, &m, sx, sy, &sx, &sy); 1397 mflags = get_map_flags (m, &m, sx, sy, &sx, &sy);
1398 if (mflags & P_OUT_OF_MAP) 1398 if (mflags & P_OUT_OF_MAP)
1399 continue; 1399 continue;
1400 if (mflags & P_IS_ALIVE) 1400 if (mflags & P_IS_ALIVE)
1401 { 1401 {
1402 for (tmp = get_map_ob (m, sx, sy); tmp; tmp = tmp->above) 1402 for (tmp = GET_MAP_OB (m, sx, sy); tmp; tmp = tmp->above)
1403 { 1403 {
1404 if (QUERY_FLAG (tmp, FLAG_ALIVE) || tmp->type == PLAYER) 1404 if (QUERY_FLAG (tmp, FLAG_ALIVE) || tmp->type == PLAYER)
1405 break; 1405 break;
1406 } 1406 }
1407 if (tmp) 1407 if (tmp)
1591 1591
1592 /* If there is nothing living on this space, no need to go further */ 1592 /* If there is nothing living on this space, no need to go further */
1593 if (!(mflags & P_IS_ALIVE)) 1593 if (!(mflags & P_IS_ALIVE))
1594 continue; 1594 continue;
1595 1595
1596 for (tmp = get_map_ob (m, nx, ny); tmp; tmp = tmp->above) 1596 for (tmp = GET_MAP_OB (m, nx, ny); tmp; tmp = tmp->above)
1597 if (QUERY_FLAG (tmp, FLAG_MONSTER)) 1597 if (QUERY_FLAG (tmp, FLAG_MONSTER))
1598 break; 1598 break;
1599 1599
1600 /* There can be living objects that are not monsters */ 1600 /* There can be living objects that are not monsters */
1601 if (!tmp || tmp->type == PLAYER) 1601 if (!tmp || tmp->type == PLAYER)
2024 return 0; 2024 return 0;
2025 } 2025 }
2026 2026
2027 if (mflags & P_IS_ALIVE && spell->attacktype) 2027 if (mflags & P_IS_ALIVE && spell->attacktype)
2028 { 2028 {
2029 for (target = get_map_ob (m, x, y); target; target = target->above) 2029 for (target = GET_MAP_OB (m, x, y); target; target = target->above)
2030 if (QUERY_FLAG (target, FLAG_MONSTER)) 2030 if (QUERY_FLAG (target, FLAG_MONSTER))
2031 { 2031 {
2032 /* oky doky. got a target monster. Lets make a blinding attack */ 2032 /* oky doky. got a target monster. Lets make a blinding attack */
2033 if (target->head) 2033 if (target->head)
2034 target = target->head; 2034 target = target->head;
2116 2116
2117 /* Only bother looking on this space if there is something living here */ 2117 /* Only bother looking on this space if there is something living here */
2118 if (mflags & P_IS_ALIVE) 2118 if (mflags & P_IS_ALIVE)
2119 { 2119 {
2120 /* search this square for a victim */ 2120 /* search this square for a victim */
2121 for (walk = get_map_ob (m, x, y); walk; walk = walk->above) 2121 for (walk = GET_MAP_OB (m, x, y); walk; walk = walk->above)
2122 if (QUERY_FLAG (walk, FLAG_MONSTER) || (walk->type == PLAYER)) 2122 if (QUERY_FLAG (walk, FLAG_MONSTER) || (walk->type == PLAYER))
2123 { /* found a victim */ 2123 { /* found a victim */
2124 object *disease = arch_to_object (spell->other_arch); 2124 object *disease = arch_to_object (spell->other_arch);
2125 2125
2126 disease->set_owner (op); 2126 disease->set_owner (op);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines