… | |
… | |
599 | |
599 | |
600 | // restore original wc, dam, attacktype and slaying |
600 | // restore original wc, dam, attacktype and slaying |
601 | op->stats.wc = op->stats.sp; |
601 | op->stats.wc = op->stats.sp; |
602 | op->stats.dam = op->stats.hp; |
602 | op->stats.dam = op->stats.hp; |
603 | op->attacktype = op->stats.grace; |
603 | op->attacktype = op->stats.grace; |
|
|
604 | op->slaying = op->custom_name; |
604 | |
605 | |
605 | if (op->spellarg) |
|
|
606 | { |
|
|
607 | op->slaying = op->spellarg; |
|
|
608 | free (op->spellarg); |
|
|
609 | op->spellarg = 0; |
|
|
610 | } |
|
|
611 | else |
|
|
612 | op->slaying = 0; |
|
|
613 | |
|
|
614 | /* Reset these to zero, so that object::can_merge will work properly */ |
606 | /* Reset these to defaults, so that object::can_merge will work properly */ |
615 | op->spellarg = NULL; |
607 | op->custom_name = 0; |
616 | op->stats.sp = 0; |
608 | op->stats.sp = 0; |
617 | op->stats.hp = 0; |
609 | op->stats.hp = 0; |
618 | op->stats.grace = 0; |
610 | op->stats.grace = 0; |
619 | op->level = 0; |
611 | op->level = 0; |
620 | op->face = op->arch->face; |
612 | op->face = op->arch->face; |
621 | op->owner = NULL; /* So that stopped arrows will be saved */ |
613 | op->owner = 0; |
|
|
614 | |
622 | update_object (op, UP_OBJ_CHANGE); |
615 | update_object (op, UP_OBJ_CHANGE); |
|
|
616 | |
623 | return op; |
617 | return op; |
624 | } |
618 | } |
625 | |
619 | |
626 | /* stop_arrow() - what to do when a non-living flying object |
620 | /* stop_arrow() - what to do when a non-living flying object |
627 | * has to stop. Sept 96 - I added in thrown object code in |
621 | * has to stop. Sept 96 - I added in thrown object code in |
… | |
… | |
816 | return; |
810 | return; |
817 | } |
811 | } |
818 | |
812 | |
819 | /* update object image for new facing */ |
813 | /* update object image for new facing */ |
820 | /* many thrown objects *don't* have more than one face */ |
814 | /* many thrown objects *don't* have more than one face */ |
821 | if (GET_ANIM_ID (op)) |
815 | if (op->has_anim ()) |
822 | SET_ANIMATION (op, op->direction); |
816 | op->set_anim_frame (op->direction); |
823 | } /* object is reflected */ |
817 | } /* object is reflected */ |
824 | } /* object ran into a wall */ |
818 | } /* object ran into a wall */ |
825 | |
819 | |
826 | /* decrease the speed as it flies. 0.05 means a standard bow will shoot |
820 | /* decrease the speed as it flies. 0.05 means a standard bow will shoot |
827 | * about 17 squares. Tune as needed. |
821 | * about 17 squares. Tune as needed. |
… | |
… | |
1281 | // check whether the face might needs to be updated |
1275 | // check whether the face might needs to be updated |
1282 | // (currently this is needed to have already switched on torches |
1276 | // (currently this is needed to have already switched on torches |
1283 | // on maps, as they just set the glow_radius in the archetype) |
1277 | // on maps, as they just set the glow_radius in the archetype) |
1284 | if (op->other_arch |
1278 | if (op->other_arch |
1285 | && ( |
1279 | && ( |
|
|
1280 | (op->flag [FLAG_ANIMATE] != op->other_arch->flag [FLAG_ANIMATE]) |
1286 | op->flag [FLAG_ANIMATE] |
1281 | || (op->flag [FLAG_ANIMATE] |
1287 | ? (op->animation_id != op->other_arch->animation_id) |
1282 | ? (op->animation_id != op->other_arch->animation_id) |
1288 | : (op->face != op->other_arch->face) |
1283 | : (op->face != op->other_arch->face)) |
1289 | )) |
1284 | )) |
1290 | get_animation_from_arch (op, op->other_arch); |
1285 | get_animation_from_arch (op, op->other_arch); |
1291 | } |
1286 | } |
1292 | |
1287 | |
1293 | // lamps and torches auf maps don't use up their fuel |
1288 | // lamps and torches auf maps don't use up their fuel |