… | |
… | |
165 | sint16 x, y; |
165 | sint16 x, y; |
166 | maptile *m; |
166 | maptile *m; |
167 | |
167 | |
168 | if (--op->duration < 0) |
168 | if (--op->duration < 0) |
169 | { |
169 | { |
170 | op->destroy (); |
170 | op->drop_and_destroy (); |
171 | return; |
171 | return; |
172 | } |
172 | } |
173 | |
173 | |
174 | hit_map (op, 0, op->attacktype, 1); |
174 | hit_map (op, 0, op->attacktype, 1); |
175 | |
175 | |
… | |
… | |
307 | |
307 | |
308 | maptile *newmap; |
308 | maptile *newmap; |
309 | mflags = get_map_flags (tmp->map, &newmap, tmp->x, tmp->y, &tmp->x, &tmp->y); |
309 | mflags = get_map_flags (tmp->map, &newmap, tmp->x, tmp->y, &tmp->x, &tmp->y); |
310 | if (mflags & P_OUT_OF_MAP) |
310 | if (mflags & P_OUT_OF_MAP) |
311 | { |
311 | { |
312 | tmp->destroy (); |
312 | tmp->drop_and_destroy (); |
313 | return 0; |
313 | return 0; |
314 | } |
314 | } |
315 | |
315 | |
316 | tmp->map = newmap; |
316 | tmp->map = newmap; |
317 | |
317 | |
318 | if (OB_TYPE_MOVE_BLOCK (tmp, GET_MAP_MOVE_BLOCK (tmp->map, tmp->x, tmp->y))) |
318 | if (OB_TYPE_MOVE_BLOCK (tmp, GET_MAP_MOVE_BLOCK (tmp->map, tmp->x, tmp->y))) |
319 | { |
319 | { |
320 | if (!QUERY_FLAG (tmp, FLAG_REFLECTING)) |
320 | if (!QUERY_FLAG (tmp, FLAG_REFLECTING)) |
321 | { |
321 | { |
322 | tmp->destroy (); |
322 | tmp->drop_and_destroy (); |
323 | return 0; |
323 | return 0; |
324 | } |
324 | } |
325 | |
325 | |
326 | tmp->x = op->x; |
326 | tmp->x = op->x; |
327 | tmp->y = op->y; |
327 | tmp->y = op->y; |
… | |
… | |
445 | tmp->set_owner (op); |
445 | tmp->set_owner (op); |
446 | tmp->skill = op->skill; |
446 | tmp->skill = op->skill; |
447 | |
447 | |
448 | owner = op->owner; |
448 | owner = op->owner; |
449 | |
449 | |
450 | if ((tmp->attacktype & AT_HOLYWORD || tmp->attacktype & AT_GODPOWER) && owner && !tailor_god_spell (tmp, owner)) |
450 | if ((tmp->attacktype & AT_HOLYWORD |
|
|
451 | || tmp->attacktype & AT_GODPOWER) |
|
|
452 | && owner |
|
|
453 | && !tailor_god_spell (tmp, owner)) |
451 | { |
454 | { |
452 | op->destroy (); |
455 | op->destroy (); |
453 | return; |
456 | return; |
454 | } |
457 | } |
455 | |
458 | |
… | |
… | |
521 | { |
524 | { |
522 | if (QUERY_FLAG (tmp, FLAG_ALIVE)) |
525 | if (QUERY_FLAG (tmp, FLAG_ALIVE)) |
523 | { |
526 | { |
524 | dam = hit_player (tmp, op->stats.dam, op, op->attacktype, 1); |
527 | dam = hit_player (tmp, op->stats.dam, op, op->attacktype, 1); |
525 | |
528 | |
|
|
529 | // TODO: can't understand the following if's |
526 | if (op->destroyed () || !tmp->destroyed () || (op->stats.dam -= dam) < 0) |
530 | if (op->destroyed () || !tmp->destroyed () || (op->stats.dam -= dam) < 0) |
527 | { |
531 | { |
528 | if (!QUERY_FLAG (op, FLAG_REMOVED)) |
532 | if (!QUERY_FLAG (op, FLAG_REMOVED)) |
529 | { |
533 | { |
530 | op->destroy (); |
534 | op->destroy (); |
… | |
… | |
733 | } |
737 | } |
734 | #endif |
738 | #endif |
735 | |
739 | |
736 | hit_map (op, 0, op->attacktype, 0); |
740 | hit_map (op, 0, op->attacktype, 0); |
737 | |
741 | |
|
|
742 | if (!op->is_on_map ()) |
|
|
743 | return; |
|
|
744 | |
738 | /* Check to see if we should push anything. |
745 | /* Check to see if we should push anything. |
739 | * Spell objects with weight push whatever they encounter to some |
746 | * Spell objects with weight push whatever they encounter to some |
740 | * degree. |
747 | * degree. |
741 | */ |
748 | */ |
742 | if (op->weight) |
749 | if (op->weight) |
|
|
750 | { |
743 | check_spell_knockback (op); |
751 | check_spell_knockback (op); |
744 | |
752 | |
745 | if (op->destroyed ()) |
753 | if (!op->is_on_map ()) |
746 | return; |
754 | return; |
|
|
755 | } |
747 | |
756 | |
748 | if (op->duration-- < 0) |
757 | if (op->duration-- < 0) |
749 | { |
758 | { |
750 | op->destroy (); |
759 | op->destroy (); |
751 | return; |
760 | return; |
… | |
… | |
1179 | void |
1188 | void |
1180 | move_missile (object *op) |
1189 | move_missile (object *op) |
1181 | { |
1190 | { |
1182 | if (op->range-- <= 0) |
1191 | if (op->range-- <= 0) |
1183 | { |
1192 | { |
1184 | op->destroy (); |
1193 | op->drop_and_destroy (); |
1185 | return; |
1194 | return; |
1186 | } |
1195 | } |
1187 | |
1196 | |
1188 | mapxy pos (op); |
1197 | mapxy pos (op); |
1189 | pos.move (op->direction); |
1198 | pos.move (op->direction); |
… | |
… | |
1739 | return; |
1748 | return; |
1740 | } |
1749 | } |
1741 | |
1750 | |
1742 | if (!op->duration || !owner->is_on_map ()) |
1751 | if (!op->duration || !owner->is_on_map ()) |
1743 | { |
1752 | { |
1744 | op->destroy (); |
1753 | op->drop_and_destroy (); |
1745 | return; |
1754 | return; |
1746 | } |
1755 | } |
1747 | |
1756 | |
1748 | op->duration--; |
1757 | op->duration--; |
1749 | |
1758 | |