… | |
… | |
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 | } |
… | |
… | |
1200 | if (effect->attacktype & AT_DEATH) |
1200 | if (effect->attacktype & AT_DEATH) |
1201 | { |
1201 | { |
1202 | effect->level = spell->stats.dam + SP_level_dam_adjust (caster, spell); |
1202 | effect->level = spell->stats.dam + SP_level_dam_adjust (caster, spell); |
1203 | |
1203 | |
1204 | /* casting death spells at undead isn't a good thing */ |
1204 | /* casting death spells at undead isn't a good thing */ |
1205 | if QUERY_FLAG |
|
|
1206 | (target, FLAG_UNDEAD) |
1205 | if (QUERY_FLAG (target, FLAG_UNDEAD)) |
1207 | { |
1206 | { |
1208 | if (random_roll (0, 2, op, PREFER_LOW)) |
1207 | if (random_roll (0, 2, op, PREFER_LOW)) |
1209 | { |
1208 | { |
1210 | new_draw_info (NDI_UNIQUE, 0, op, "Idiot! Your spell boomerangs!"); |
1209 | new_draw_info (NDI_UNIQUE, 0, op, "Idiot! Your spell boomerangs!"); |
1211 | effect->x = op->x; |
1210 | effect->x = op->x; |
… | |
… | |
1398 | mflags = get_map_flags (m, &m, sx, sy, &sx, &sy); |
1397 | mflags = get_map_flags (m, &m, sx, sy, &sx, &sy); |
1399 | if (mflags & P_OUT_OF_MAP) |
1398 | if (mflags & P_OUT_OF_MAP) |
1400 | continue; |
1399 | continue; |
1401 | if (mflags & P_IS_ALIVE) |
1400 | if (mflags & P_IS_ALIVE) |
1402 | { |
1401 | { |
1403 | 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) |
1404 | { |
1403 | { |
1405 | if (QUERY_FLAG (tmp, FLAG_ALIVE) || tmp->type == PLAYER) |
1404 | if (QUERY_FLAG (tmp, FLAG_ALIVE) || tmp->type == PLAYER) |
1406 | break; |
1405 | break; |
1407 | } |
1406 | } |
1408 | if (tmp) |
1407 | if (tmp) |
… | |
… | |
1531 | force->stats.ac = spell_ob->stats.ac; |
1530 | force->stats.ac = spell_ob->stats.ac; |
1532 | force->stats.wc = spell_ob->stats.wc; |
1531 | force->stats.wc = spell_ob->stats.wc; |
1533 | |
1532 | |
1534 | change_abil (tmp, force); /* Mostly to display any messages */ |
1533 | change_abil (tmp, force); /* Mostly to display any messages */ |
1535 | insert_ob_in_ob (force, tmp); |
1534 | insert_ob_in_ob (force, tmp); |
1536 | fix_player (tmp); |
1535 | tmp->update_stats (); |
1537 | return 1; |
1536 | return 1; |
1538 | |
1537 | |
1539 | } |
1538 | } |
1540 | |
1539 | |
1541 | |
1540 | |
… | |
… | |
1592 | |
1591 | |
1593 | /* 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 */ |
1594 | if (!(mflags & P_IS_ALIVE)) |
1593 | if (!(mflags & P_IS_ALIVE)) |
1595 | continue; |
1594 | continue; |
1596 | |
1595 | |
1597 | 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) |
1598 | if (QUERY_FLAG (tmp, FLAG_MONSTER)) |
1597 | if (QUERY_FLAG (tmp, FLAG_MONSTER)) |
1599 | break; |
1598 | break; |
1600 | |
1599 | |
1601 | /* There can be living objects that are not monsters */ |
1600 | /* There can be living objects that are not monsters */ |
1602 | if (!tmp || tmp->type == PLAYER) |
1601 | if (!tmp || tmp->type == PLAYER) |
… | |
… | |
2025 | return 0; |
2024 | return 0; |
2026 | } |
2025 | } |
2027 | |
2026 | |
2028 | if (mflags & P_IS_ALIVE && spell->attacktype) |
2027 | if (mflags & P_IS_ALIVE && spell->attacktype) |
2029 | { |
2028 | { |
2030 | 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) |
2031 | if (QUERY_FLAG (target, FLAG_MONSTER)) |
2030 | if (QUERY_FLAG (target, FLAG_MONSTER)) |
2032 | { |
2031 | { |
2033 | /* oky doky. got a target monster. Lets make a blinding attack */ |
2032 | /* oky doky. got a target monster. Lets make a blinding attack */ |
2034 | if (target->head) |
2033 | if (target->head) |
2035 | target = target->head; |
2034 | target = target->head; |
… | |
… | |
2117 | |
2116 | |
2118 | /* 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 */ |
2119 | if (mflags & P_IS_ALIVE) |
2118 | if (mflags & P_IS_ALIVE) |
2120 | { |
2119 | { |
2121 | /* search this square for a victim */ |
2120 | /* search this square for a victim */ |
2122 | 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) |
2123 | if (QUERY_FLAG (walk, FLAG_MONSTER) || (walk->type == PLAYER)) |
2122 | if (QUERY_FLAG (walk, FLAG_MONSTER) || (walk->type == PLAYER)) |
2124 | { /* found a victim */ |
2123 | { /* found a victim */ |
2125 | object *disease = arch_to_object (spell->other_arch); |
2124 | object *disease = arch_to_object (spell->other_arch); |
2126 | |
2125 | |
2127 | disease->set_owner (op); |
2126 | disease->set_owner (op); |