From 3ee3c36bb7013cfe25662410b075afafd229d019 Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Thu, 29 Oct 2009 19:16:59 -0500 Subject: When using items that can directly turn monsters to zombies (weapons of shadows or chaos) as a good god worshipper, ensure that the "turns into a zombie" message always comes before the "enraged by your holy aura" message. --- crawl-ref/source/fight.cc | 6 ++++-- crawl-ref/source/item_use.cc | 10 ++++++---- crawl-ref/source/spells3.cc | 12 ++++++++---- crawl-ref/source/spells3.h | 3 ++- 4 files changed, 20 insertions(+), 11 deletions(-) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index f6399bd8a7..ee0d6cb880 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -2770,7 +2770,7 @@ static bool _make_zombie(monsters* mon, int corpse_class, int corpse_index, mitm[last_item].link = idx; animate_remains(mon->pos(), CORPSE_BODY, mon->behaviour, - mon->foe, mon->god, true, true, &zombie_index); + mon->foe, mon->god, true, true, true, &zombie_index); } // No equipment to get, or couldn't get it for some reason. @@ -2781,7 +2781,7 @@ static bool _make_zombie(monsters* mon, int corpse_class, int corpse_index, zombie_index = create_monster( mgen_data(type, mon->behaviour, 0, 0, mon->pos(), mon->foe, MG_FORCE_PLACE, mon->god, - (monster_type) mon->type, mon->number)); + mon->type, mon->number)); } if (zombie_index == -1) @@ -2809,6 +2809,8 @@ static bool _make_zombie(monsters* mon, int corpse_class, int corpse_index, autotoggle_autopickup(false); } + player_angers_monster(zombie); + return (true); } diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index a873bdbdf9..c494766aeb 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -1762,17 +1762,19 @@ static bool _reaping_hit_victim(bolt& beam, actor* victim, int dmg, int corpse) int midx = NON_MONSTER; if (animate_remains(victim->pos(), CORPSE_BODY, beh, hitting, GOD_NO_GOD, - true, true, &midx) <= 0) + true, true, true, &midx) <= 0) { return (false); } - monsters *zomb = &menv[midx]; + monsters *zombie = &menv[midx]; if (you.can_see(victim)) mprf("%s turns into a zombie!", victim->name(DESC_CAP_THE).c_str()); - else if (you.can_see(zomb)) - mprf("%s appears out of thin air!", zomb->name(DESC_CAP_THE).c_str()); + else if (you.can_see(zombie)) + mprf("%s appears out of thin air!", zombie->name(DESC_CAP_THE).c_str()); + + player_angers_monster(zombie); return (true); } diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc index 7ea2fff9b4..094595ca72 100644 --- a/crawl-ref/source/spells3.cc +++ b/crawl-ref/source/spells3.cc @@ -921,7 +921,7 @@ void equip_undead(const coord_def &a, int corps, int monster, int monnum) static bool _raise_remains(const coord_def &pos, int corps, beh_type beha, unsigned short hitting, god_type god, bool actual, - int* mon_index) + bool force_beh, int* mon_index) { if (mon_index != NULL) *mon_index = -1; @@ -967,7 +967,7 @@ static bool _raise_remains(const coord_def &pos, int corps, beh_type beha, int monster = create_monster( mgen_data(mon, beha, 0, 0, pos, hitting, - 0, god, + MG_FORCE_BEH, god, zombie_type, number)); if (mon_index != NULL) @@ -985,6 +985,9 @@ static bool _raise_remains(const coord_def &pos, int corps, beh_type beha, destroy_item(corps); + if (!force_beh) + player_angers_monster(&menv[monster]); + return (true); } @@ -993,7 +996,8 @@ static bool _raise_remains(const coord_def &pos, int corps, beh_type beha, int animate_remains(const coord_def &a, corpse_type class_allowed, beh_type beha, unsigned short hitting, god_type god, bool actual, - bool quiet, int* mon_index) + bool quiet, bool force_beh, + int* mon_index) { if (is_sanctuary(a)) return (0); @@ -1016,7 +1020,7 @@ int animate_remains(const coord_def &a, corpse_type class_allowed, const bool was_butchering = is_being_butchered(*si); success = _raise_remains(a, si.link(), beha, hitting, god, actual, - mon_index); + force_beh, mon_index); if (actual && success) { diff --git a/crawl-ref/source/spells3.h b/crawl-ref/source/spells3.h index 7880cd1b36..945078f45b 100644 --- a/crawl-ref/source/spells3.h +++ b/crawl-ref/source/spells3.h @@ -54,7 +54,8 @@ void equip_undead(const coord_def &a, int corps, int monster, int monnum); int animate_remains(const coord_def &a, corpse_type class_allowed, beh_type beha, unsigned short hitting, god_type god = GOD_NO_GOD, bool actual = true, - bool quiet = false, int* mon_index = NULL); + bool quiet = false, bool force_beh = false, + int* mon_index = NULL); int animate_dead(actor *caster, int pow, beh_type beha, unsigned short hitting, god_type god = GOD_NO_GOD, bool actual = true); -- cgit v1.2.3-54-g00ecf