… | |
… | |
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_inv (true); // be explicit about dropping |
170 | op->destroy (); |
171 | op->destroy (true); |
171 | return; |
172 | return; |
172 | } |
173 | } |
173 | |
174 | |
174 | hit_map (op, 0, op->attacktype, 1); |
175 | hit_map (op, 0, op->attacktype, 1); |
175 | |
176 | |
… | |
… | |
307 | |
308 | |
308 | maptile *newmap; |
309 | maptile *newmap; |
309 | mflags = get_map_flags (tmp->map, &newmap, tmp->x, tmp->y, &tmp->x, &tmp->y); |
310 | mflags = get_map_flags (tmp->map, &newmap, tmp->x, tmp->y, &tmp->x, &tmp->y); |
310 | if (mflags & P_OUT_OF_MAP) |
311 | if (mflags & P_OUT_OF_MAP) |
311 | { |
312 | { |
|
|
313 | tmp->destroy_inv (true); // be explicit about dropping |
312 | tmp->destroy (); |
314 | tmp->destroy (true); |
313 | return 0; |
315 | return 0; |
314 | } |
316 | } |
315 | |
317 | |
316 | tmp->map = newmap; |
318 | tmp->map = newmap; |
317 | |
319 | |
318 | if (OB_TYPE_MOVE_BLOCK (tmp, GET_MAP_MOVE_BLOCK (tmp->map, tmp->x, tmp->y))) |
320 | if (OB_TYPE_MOVE_BLOCK (tmp, GET_MAP_MOVE_BLOCK (tmp->map, tmp->x, tmp->y))) |
319 | { |
321 | { |
320 | if (!QUERY_FLAG (tmp, FLAG_REFLECTING)) |
322 | if (!QUERY_FLAG (tmp, FLAG_REFLECTING)) |
321 | { |
323 | { |
|
|
324 | tmp->destroy_inv (true); // be explicit about dropping |
322 | tmp->destroy (); |
325 | tmp->destroy (true); |
323 | return 0; |
326 | return 0; |
324 | } |
327 | } |
325 | |
328 | |
326 | tmp->x = op->x; |
329 | tmp->x = op->x; |
327 | tmp->y = op->y; |
330 | tmp->y = op->y; |
… | |
… | |
351 | maptile *m = op->map; |
354 | maptile *m = op->map; |
352 | int i; |
355 | int i; |
353 | |
356 | |
354 | if (--op->duration < 0) |
357 | if (--op->duration < 0) |
355 | { |
358 | { |
356 | op->destroy (); |
359 | op->destroy (true); |
357 | return; |
360 | return; |
358 | } |
361 | } |
359 | |
362 | |
360 | hit_map (op, 0, op->attacktype, 0); |
363 | hit_map (op, 0, op->attacktype, 0); |
361 | |
364 | |
… | |
… | |
393 | void |
396 | void |
394 | explode_bullet (object *op) |
397 | explode_bullet (object *op) |
395 | { |
398 | { |
396 | object *tmp, *owner; |
399 | object *tmp, *owner; |
397 | |
400 | |
398 | if (op->other_arch == NULL) |
401 | if (!op->other_arch) |
399 | { |
402 | { |
400 | LOG (llevError, "BUG: explode_bullet(): op without other_arch\n"); |
403 | LOG (llevError, "BUG: explode_bullet(): op without other_arch\n"); |
401 | op->destroy (); |
404 | op->destroy (true); |
402 | return; |
405 | return; |
403 | } |
406 | } |
404 | |
407 | |
405 | if (op->env) |
408 | if (op->env) |
406 | { |
409 | { |
407 | object *env = op->outer_env (); |
410 | object *env = op->outer_env (); |
408 | |
411 | |
409 | if (!env->map || out_of_map (env->map, env->x, env->y)) |
412 | if (!env->map || out_of_map (env->map, env->x, env->y)) |
410 | { |
413 | { |
411 | LOG (llevError, "BUG: explode_bullet(): env out of map\n"); |
414 | LOG (llevError, "BUG: explode_bullet(): env out of map\n"); |
412 | op->destroy (); |
415 | op->destroy (true); |
413 | return; |
416 | return; |
414 | } |
417 | } |
415 | |
418 | |
416 | op->insert_at (env, op, INS_NO_MERGE | INS_NO_WALK_ON); |
419 | op->insert_at (env, op, INS_NO_MERGE | INS_NO_WALK_ON); |
417 | } |
420 | } |
418 | else if (out_of_map (op->map, op->x, op->y)) |
421 | else if (out_of_map (op->map, op->x, op->y)) |
419 | { |
422 | { |
420 | LOG (llevError, "BUG: explode_bullet(): op out of map\n"); |
423 | LOG (llevError, "BUG: explode_bullet(): op out of map\n"); |
421 | op->destroy (); |
424 | op->destroy (true); |
422 | return; |
425 | return; |
423 | } |
426 | } |
424 | |
427 | |
425 | // elmex Tue Aug 15 17:46:51 CEST 2006: Prevent explosions of any kind on safe maps |
428 | // elmex Tue Aug 15 17:46:51 CEST 2006: Prevent explosions of any kind on safe maps |
426 | // NOTE: If this breaks something important: remove this. I can't think of anything |
429 | // NOTE: If this breaks something important: remove this. I can't think of anything |
427 | // bad at the moment that might happen from this. |
430 | // bad at the moment that might happen from this. |
428 | if (get_map_flags (op->map, NULL, op->x, op->y, NULL, NULL) & P_SAFE) |
431 | if (get_map_flags (op->map, NULL, op->x, op->y, NULL, NULL) & P_SAFE) |
429 | { |
432 | { |
430 | op->destroy (); |
433 | op->destroy (true); |
431 | return; |
434 | return; |
432 | } |
435 | } |
433 | |
436 | |
434 | if (op->attacktype) |
437 | if (op->attacktype) |
435 | { |
438 | { |
… | |
… | |
445 | tmp->set_owner (op); |
448 | tmp->set_owner (op); |
446 | tmp->skill = op->skill; |
449 | tmp->skill = op->skill; |
447 | |
450 | |
448 | owner = op->owner; |
451 | owner = op->owner; |
449 | |
452 | |
450 | if ((tmp->attacktype & AT_HOLYWORD || tmp->attacktype & AT_GODPOWER) && owner && !tailor_god_spell (tmp, owner)) |
453 | if ((tmp->attacktype & AT_HOLYWORD |
|
|
454 | || tmp->attacktype & AT_GODPOWER) |
|
|
455 | && owner |
|
|
456 | && !tailor_god_spell (tmp, owner)) |
451 | { |
457 | { |
452 | op->destroy (); |
458 | op->destroy (true); |
453 | return; |
459 | return; |
454 | } |
460 | } |
455 | |
461 | |
456 | /* special for bombs - it actually has sane values for these */ |
462 | /* special for bombs - it actually has sane values for these */ |
457 | if (op->type == SPELL_EFFECT && op->subtype == SP_BOMB) |
463 | if (op->type == SPELL_EFFECT && op->subtype == SP_BOMB) |
… | |
… | |
485 | |
491 | |
486 | tmp->insert_at (op, op); |
492 | tmp->insert_at (op, op); |
487 | tmp->play_sound (tmp->sound); |
493 | tmp->play_sound (tmp->sound); |
488 | |
494 | |
489 | /* remove the firebullet */ |
495 | /* remove the firebullet */ |
490 | op->destroy (); |
496 | op->destroy (true); |
491 | } |
497 | } |
492 | |
498 | |
493 | /* checks to see what op should do, given the space it is on |
499 | /* checks to see what op should do, given the space it is on |
494 | * (eg, explode, damage player, etc) |
500 | * (eg, explode, damage player, etc) |
495 | */ |
501 | */ |
… | |
… | |
521 | { |
527 | { |
522 | if (QUERY_FLAG (tmp, FLAG_ALIVE)) |
528 | if (QUERY_FLAG (tmp, FLAG_ALIVE)) |
523 | { |
529 | { |
524 | dam = hit_player (tmp, op->stats.dam, op, op->attacktype, 1); |
530 | dam = hit_player (tmp, op->stats.dam, op, op->attacktype, 1); |
525 | |
531 | |
|
|
532 | // TODO: can't understand the following if's |
526 | if (op->destroyed () || !tmp->destroyed () || (op->stats.dam -= dam) < 0) |
533 | if (op->destroyed () || !tmp->destroyed () || (op->stats.dam -= dam) < 0) |
527 | { |
534 | { |
528 | if (!QUERY_FLAG (op, FLAG_REMOVED)) |
535 | if (!QUERY_FLAG (op, FLAG_REMOVED)) |
529 | { |
536 | { |
530 | op->destroy (); |
537 | op->destroy (true); |
531 | return; |
538 | return; |
532 | } |
539 | } |
533 | } |
540 | } |
534 | } |
541 | } |
535 | } |
542 | } |
… | |
… | |
564 | if (--op->range <= 0) |
571 | if (--op->range <= 0) |
565 | { |
572 | { |
566 | if (op->other_arch) |
573 | if (op->other_arch) |
567 | explode_bullet (op); |
574 | explode_bullet (op); |
568 | else |
575 | else |
569 | op->destroy (); |
576 | op->destroy (true); |
570 | |
577 | |
571 | return; |
578 | return; |
572 | } |
579 | } |
573 | |
580 | |
574 | new_x = op->x + DIRX (op); |
581 | new_x = op->x + DIRX (op); |
… | |
… | |
576 | m = op->map; |
583 | m = op->map; |
577 | mflags = get_map_flags (m, &m, new_x, new_y, &new_x, &new_y); |
584 | mflags = get_map_flags (m, &m, new_x, new_y, &new_x, &new_y); |
578 | |
585 | |
579 | if (mflags & P_OUT_OF_MAP) |
586 | if (mflags & P_OUT_OF_MAP) |
580 | { |
587 | { |
581 | op->destroy (); |
588 | op->destroy (true); |
582 | return; |
589 | return; |
583 | } |
590 | } |
584 | |
591 | |
585 | if (!op->direction || OB_TYPE_MOVE_BLOCK (op, GET_MAP_MOVE_BLOCK (m, new_x, new_y))) |
592 | if (!op->direction || OB_TYPE_MOVE_BLOCK (op, GET_MAP_MOVE_BLOCK (m, new_x, new_y))) |
586 | { |
593 | { |
587 | if (op->other_arch) |
594 | if (op->other_arch) |
588 | explode_bullet (op); |
595 | explode_bullet (op); |
589 | else |
596 | else |
590 | op->destroy (); |
597 | op->destroy (true); |
591 | |
598 | |
592 | return; |
599 | return; |
593 | } |
600 | } |
594 | |
601 | |
595 | if (!(op = m->insert (op, new_x, new_y, op))) |
602 | if (!(op = m->insert (op, new_x, new_y, op))) |
… | |
… | |
651 | |
658 | |
652 | maptile *newmap; |
659 | maptile *newmap; |
653 | mflags = get_map_flags (tmp->map, &newmap, tmp->x, tmp->y, &tmp->x, &tmp->y); |
660 | mflags = get_map_flags (tmp->map, &newmap, tmp->x, tmp->y, &tmp->x, &tmp->y); |
654 | if (mflags & P_OUT_OF_MAP) |
661 | if (mflags & P_OUT_OF_MAP) |
655 | { |
662 | { |
656 | tmp->destroy (); |
663 | tmp->destroy (true); |
657 | return 0; |
664 | return 0; |
658 | } |
665 | } |
659 | |
666 | |
660 | tmp->map = newmap; |
667 | tmp->map = newmap; |
661 | |
668 | |
662 | if (OB_TYPE_MOVE_BLOCK (tmp, GET_MAP_MOVE_BLOCK (tmp->map, tmp->x, tmp->y))) |
669 | if (OB_TYPE_MOVE_BLOCK (tmp, GET_MAP_MOVE_BLOCK (tmp->map, tmp->x, tmp->y))) |
663 | { |
670 | { |
664 | if (!QUERY_FLAG (tmp, FLAG_REFLECTING)) |
671 | if (!QUERY_FLAG (tmp, FLAG_REFLECTING)) |
665 | { |
672 | { |
666 | tmp->destroy (); |
673 | tmp->destroy (true); |
667 | return 0; |
674 | return 0; |
668 | } |
675 | } |
669 | |
676 | |
670 | tmp->x = op->x; |
677 | tmp->x = op->x; |
671 | tmp->y = op->y; |
678 | tmp->y = op->y; |
… | |
… | |
726 | * when their cone dies when they die. |
733 | * when their cone dies when they die. |
727 | */ |
734 | */ |
728 | /* If no owner left, the spell dies out. */ |
735 | /* If no owner left, the spell dies out. */ |
729 | if (op->owner == NULL) |
736 | if (op->owner == NULL) |
730 | { |
737 | { |
731 | op->destroy (); |
738 | op->destroy (true); |
732 | return; |
739 | return; |
733 | } |
740 | } |
734 | #endif |
741 | #endif |
735 | |
742 | |
736 | hit_map (op, 0, op->attacktype, 0); |
743 | hit_map (op, 0, op->attacktype, 0); |
… | |
… | |
743 | check_spell_knockback (op); |
750 | check_spell_knockback (op); |
744 | |
751 | |
745 | if (op->destroyed ()) |
752 | if (op->destroyed ()) |
746 | return; |
753 | return; |
747 | |
754 | |
748 | if ((op->duration--) < 0) |
755 | if (op->duration-- < 0) |
749 | { |
756 | { |
750 | op->destroy (); |
757 | op->destroy (true); |
751 | return; |
758 | return; |
752 | } |
759 | } |
753 | /* Object has hit maximum range, so don't have it move |
760 | /* Object has hit maximum range, so don't have it move |
754 | * any further. When the duration above expires, |
761 | * any further. When the duration above expires, |
755 | * then the object will get removed. |
762 | * then the object will get removed. |
… | |
… | |
860 | |
867 | |
861 | success = 1; |
868 | success = 1; |
862 | tmp = arch_to_object (spell->other_arch); |
869 | tmp = arch_to_object (spell->other_arch); |
863 | tmp->set_owner (op); |
870 | tmp->set_owner (op); |
864 | set_spell_skill (op, caster, spell, tmp); |
871 | set_spell_skill (op, caster, spell, tmp); |
865 | tmp->level = caster_level (caster, spell); |
872 | tmp->level = casting_level (caster, spell); |
866 | tmp->attacktype = spell->attacktype; |
873 | tmp->attacktype = spell->attacktype; |
867 | |
874 | |
868 | /* holy word stuff */ |
875 | /* holy word stuff */ |
869 | if ((tmp->attacktype & AT_HOLYWORD) || (tmp->attacktype & AT_GODPOWER)) |
876 | if ((tmp->attacktype & AT_HOLYWORD) || (tmp->attacktype & AT_GODPOWER)) |
870 | if (!tailor_god_spell (tmp, op)) |
877 | if (!tailor_god_spell (tmp, op)) |
… | |
… | |
954 | // elmex Tue Aug 15 17:46:51 CEST 2006: Prevent bomb from exploding |
961 | // elmex Tue Aug 15 17:46:51 CEST 2006: Prevent bomb from exploding |
955 | // on a safe map. I don't like this special casing, but it seems to be neccessary |
962 | // on a safe map. I don't like this special casing, but it seems to be neccessary |
956 | // as bombs can be carried. |
963 | // as bombs can be carried. |
957 | if (get_map_flags (op->map, NULL, op->x, op->y, NULL, NULL) & P_SAFE) |
964 | if (get_map_flags (op->map, NULL, op->x, op->y, NULL, NULL) & P_SAFE) |
958 | { |
965 | { |
959 | op->destroy (); |
966 | op->destroy (true); |
960 | return; |
967 | return; |
961 | } |
968 | } |
962 | |
969 | |
963 | /* This copies a lot of the code from the fire bullet, |
970 | /* This copies a lot of the code from the fire bullet, |
964 | * but using the cast_bullet isn't really feasible, |
971 | * but using the cast_bullet isn't really feasible, |
… | |
… | |
1112 | effect = arch_to_object (spell->other_arch); |
1119 | effect = arch_to_object (spell->other_arch); |
1113 | else |
1120 | else |
1114 | return 0; |
1121 | return 0; |
1115 | |
1122 | |
1116 | /* tailor the effect by priest level and worshipped God */ |
1123 | /* tailor the effect by priest level and worshipped God */ |
1117 | effect->level = caster_level (caster, spell); |
1124 | effect->level = casting_level (caster, spell); |
1118 | effect->attacktype = spell->attacktype; |
1125 | effect->attacktype = spell->attacktype; |
1119 | if (effect->attacktype & (AT_HOLYWORD | AT_GODPOWER)) |
1126 | if (effect->attacktype & (AT_HOLYWORD | AT_GODPOWER)) |
1120 | { |
1127 | { |
1121 | if (tailor_god_spell (effect, op)) |
1128 | if (tailor_god_spell (effect, op)) |
1122 | new_draw_info_format (NDI_UNIQUE, 0, op, "%s answers your call!", determine_god (op)); |
1129 | new_draw_info_format (NDI_UNIQUE, 0, op, "%s answers your call!", determine_god (op)); |
… | |
… | |
1146 | } |
1153 | } |
1147 | else |
1154 | else |
1148 | { |
1155 | { |
1149 | new_draw_info_format (NDI_UNIQUE, 0, op, "The %s looks stronger!", query_name (target)); |
1156 | new_draw_info_format (NDI_UNIQUE, 0, op, "The %s looks stronger!", query_name (target)); |
1150 | target->stats.hp = target->stats.maxhp * 2; |
1157 | target->stats.hp = target->stats.maxhp * 2; |
1151 | effect->destroy (); |
1158 | effect->destroy (true); |
1152 | return 0; |
1159 | return 0; |
1153 | } |
1160 | } |
1154 | } |
1161 | } |
1155 | } |
1162 | } |
1156 | else |
1163 | else |
… | |
… | |
1179 | void |
1186 | void |
1180 | move_missile (object *op) |
1187 | move_missile (object *op) |
1181 | { |
1188 | { |
1182 | if (op->range-- <= 0) |
1189 | if (op->range-- <= 0) |
1183 | { |
1190 | { |
|
|
1191 | op->destroy_inv (true); // be explicit about dropping |
1184 | op->destroy (); |
1192 | op->destroy (true); |
1185 | return; |
1193 | return; |
1186 | } |
1194 | } |
1187 | |
1195 | |
1188 | mapxy pos (op); |
1196 | mapxy pos (op); |
1189 | pos.move (op->direction); |
1197 | pos.move (op->direction); |
1190 | |
1198 | |
1191 | if (!pos.normalise ()) |
1199 | if (!pos.normalise ()) |
1192 | { |
1200 | { |
1193 | op->destroy (); |
1201 | op->destroy (true); |
1194 | return; |
1202 | return; |
1195 | } |
1203 | } |
1196 | |
1204 | |
1197 | mapspace &ms = pos.ms (); |
1205 | mapspace &ms = pos.ms (); |
1198 | |
1206 | |
… | |
… | |
1200 | { |
1208 | { |
1201 | hit_map (op, op->direction, AT_MAGIC, 1); |
1209 | hit_map (op, op->direction, AT_MAGIC, 1); |
1202 | /* Basically, missile only hits one thing then goes away. |
1210 | /* Basically, missile only hits one thing then goes away. |
1203 | * we need to remove it if someone hasn't already done so. |
1211 | * we need to remove it if someone hasn't already done so. |
1204 | */ |
1212 | */ |
1205 | op->destroy (); |
1213 | op->destroy (true); |
1206 | return; |
1214 | return; |
1207 | } |
1215 | } |
1208 | |
1216 | |
1209 | if (!op->direction) |
1217 | if (!op->direction) |
1210 | { |
1218 | { |
1211 | op->destroy (); |
1219 | op->destroy (true); |
1212 | return; |
1220 | return; |
1213 | } |
1221 | } |
1214 | |
1222 | |
1215 | int i = spell_find_dir (pos.m, pos.x, pos.y, op->owner); |
1223 | int i = spell_find_dir (pos.m, pos.x, pos.y, op->owner); |
1216 | if (i > 0 && i != op->direction) |
1224 | if (i > 0 && i != op->direction) |
… | |
… | |
1451 | |
1459 | |
1452 | /* We precompute some values here so that we don't have to keep |
1460 | /* We precompute some values here so that we don't have to keep |
1453 | * doing it over and over again. |
1461 | * doing it over and over again. |
1454 | */ |
1462 | */ |
1455 | god = find_god (determine_god (op)); |
1463 | god = find_god (determine_god (op)); |
1456 | level = caster_level (caster, spell); |
1464 | level = casting_level (caster, spell); |
1457 | range = spell->range + SP_level_range_adjust (caster, spell); |
1465 | range = spell->range + SP_level_range_adjust (caster, spell); |
1458 | |
1466 | |
1459 | /* On the bright side, no monster should ever have a race of GOD_... |
1467 | /* On the bright side, no monster should ever have a race of GOD_... |
1460 | * so even if the player doesn't worship a god, if race=GOD_.., it |
1468 | * so even if the player doesn't worship a god, if race=GOD_.., it |
1461 | * won't ever match anything. |
1469 | * won't ever match anything. |
… | |
… | |
1733 | object *owner = op->env; |
1741 | object *owner = op->env; |
1734 | |
1742 | |
1735 | if (!owner) // MUST not happen, remove when true TODO |
1743 | if (!owner) // MUST not happen, remove when true TODO |
1736 | { |
1744 | { |
1737 | LOG (llevError, "swarm spell found outside inventory: %s\n", op->debug_desc ()); |
1745 | LOG (llevError, "swarm spell found outside inventory: %s\n", op->debug_desc ()); |
1738 | op->destroy (); |
1746 | op->destroy (true); |
1739 | return; |
1747 | return; |
1740 | } |
1748 | } |
1741 | |
1749 | |
1742 | if (!op->duration || !owner->is_on_map ()) |
1750 | if (!op->duration || !owner->is_on_map ()) |
1743 | { |
1751 | { |
|
|
1752 | op->destroy_inv (true); // be explicit about dropping |
1744 | op->destroy (); |
1753 | op->destroy (true); |
1745 | return; |
1754 | return; |
1746 | } |
1755 | } |
1747 | |
1756 | |
1748 | op->duration--; |
1757 | op->duration--; |
1749 | |
1758 | |
1750 | int basedir = op->direction; |
1759 | int basedir = op->direction; |
1751 | if (!basedir) |
1760 | if (!basedir) |
|
|
1761 | { |
1752 | /* spray in all directions! 8) */ |
1762 | /* spray in all directions! 8) */ |
1753 | basedir = (op->facing += op->state) % 8 + 1; |
1763 | op->facing = (op->facing + op->state) & 7; |
|
|
1764 | basedir = op->facing + 1; |
|
|
1765 | } |
1754 | |
1766 | |
1755 | #if 0 |
1767 | #if 0 |
1756 | // this is bogus: it causes wrong places to be checked below |
1768 | // this is bogus: it causes wrong places to be checked below |
1757 | // (a wall 2 cells away will block the effect...) and |
1769 | // (a wall 2 cells away will block the effect...) and |
1758 | // doesn't work for SP_BULLET anyhow, so again tests the wrong |
1770 | // doesn't work for SP_BULLET anyhow, so again tests the wrong |
… | |
… | |
1840 | { |
1852 | { |
1841 | if (!spell->other_arch) |
1853 | if (!spell->other_arch) |
1842 | return 0; |
1854 | return 0; |
1843 | |
1855 | |
1844 | object *tmp = archetype::get (SWARM_SPELL); |
1856 | object *tmp = archetype::get (SWARM_SPELL); |
|
|
1857 | |
1845 | set_spell_skill (op, caster, spell, tmp); |
1858 | set_spell_skill (op, caster, spell, tmp); |
1846 | tmp->level = caster_level (caster, spell); /* needed later, to get level dep. right. */ |
1859 | tmp->level = casting_level (caster, spell); /* needed later, to get level dep. right. */ |
1847 | tmp->spell = spell->other_arch->instance (); |
1860 | tmp->spell = spell->other_arch->instance (); |
1848 | tmp->attacktype = tmp->spell->attacktype; |
1861 | tmp->attacktype = tmp->spell->attacktype; |
1849 | |
1862 | |
1850 | if (tmp->attacktype & AT_HOLYWORD || tmp->attacktype & AT_GODPOWER) |
1863 | if (tmp->attacktype & AT_HOLYWORD || tmp->attacktype & AT_GODPOWER) |
1851 | if (!tailor_god_spell (tmp, op)) |
1864 | if (!tailor_god_spell (tmp, op)) |
… | |
… | |
1994 | object *disease = arch_to_object (spell->other_arch); |
2007 | object *disease = arch_to_object (spell->other_arch); |
1995 | |
2008 | |
1996 | disease->set_owner (op); |
2009 | disease->set_owner (op); |
1997 | set_spell_skill (op, caster, spell, disease); |
2010 | set_spell_skill (op, caster, spell, disease); |
1998 | disease->stats.exp = 0; |
2011 | disease->stats.exp = 0; |
1999 | disease->level = caster_level (caster, spell); |
2012 | disease->level = casting_level (caster, spell); |
2000 | |
2013 | |
2001 | /* do level adjustments */ |
2014 | /* do level adjustments */ |
2002 | if (disease->stats.wc) |
2015 | if (disease->stats.wc) |
2003 | disease->stats.wc += dur_mod / 2; |
2016 | disease->stats.wc += dur_mod / 2; |
2004 | |
2017 | |
… | |
… | |
2048 | |
2061 | |
2049 | if (infect_object (walk, disease, 1)) |
2062 | if (infect_object (walk, disease, 1)) |
2050 | { |
2063 | { |
2051 | new_draw_info_format (NDI_UNIQUE, 0, op, "You inflict %s on %s!", &disease->name, &walk->name); |
2064 | new_draw_info_format (NDI_UNIQUE, 0, op, "You inflict %s on %s!", &disease->name, &walk->name); |
2052 | |
2065 | |
2053 | disease->destroy (); /* don't need this one anymore */ |
2066 | disease->destroy (true); /* don't need this one anymore */ |
2054 | walk->map->insert (get_archetype ("detect_magic"), x, y, op); |
2067 | walk->map->insert (get_archetype ("detect_magic"), x, y, op); |
2055 | return 1; |
2068 | return 1; |
2056 | } |
2069 | } |
2057 | |
2070 | |
2058 | disease->destroy (); |
2071 | disease->destroy (true); |
2059 | } |
2072 | } |
2060 | } /* if living creature */ |
2073 | } /* if living creature */ |
2061 | } /* for range of spaces */ |
2074 | } /* for range of spaces */ |
2062 | |
2075 | |
2063 | new_draw_info (NDI_UNIQUE, 0, op, "No one caught anything!"); |
2076 | new_draw_info (NDI_UNIQUE, 0, op, "No one caught anything!"); |