diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-05-05 13:33:29 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-05-05 13:33:29 +0000 |
commit | ff2f267821153758bcd691e73b1b409c62f0c4e0 (patch) | |
tree | 11f18df98aad81ddfa9798dafd67eceb3b4ed510 /crawl-ref/source/fight.cc | |
parent | 3423bbab5a0f024eeafffe6b8260c8c088647db1 (diff) | |
download | crawl-ref-ff2f267821153758bcd691e73b1b409c62f0c4e0.tar.gz crawl-ref-ff2f267821153758bcd691e73b1b409c62f0c4e0.zip |
Cleaned up monster generation functions, separate monster zombie type from monster number. May be buggy.
Allow hydra zombies (they currently do not get the right number of heads).
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4872 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/fight.cc')
-rw-r--r-- | crawl-ref/source/fight.cc | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index 0002593197..d371ec79a9 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -2343,16 +2343,20 @@ bool melee_attack::chop_hydra_head( int dam, def_name(DESC_NOCAP_THE).c_str() ); } - if (wpn_brand == SPWPN_FLAMING) + // Only living hydras get to regenerate heads. + if (defender->holiness() == MH_NATURAL) { - if (defender_visible) - mpr( "The flame cauterises the wound!" ); - } - else if (def->number < 19) - { - simple_monster_message( def, " grows two more!" ); - def->number += 2; - heal_monster( def, 8 + random2(8), true ); + if (wpn_brand == SPWPN_FLAMING) + { + if (defender_visible) + mpr( "The flame cauterises the wound!" ); + } + else if (def->number < 19) + { + simple_monster_message( def, " grows two more!" ); + def->number += 2; + heal_monster( def, 8 + random2(8), true ); + } } } @@ -2364,7 +2368,7 @@ bool melee_attack::chop_hydra_head( int dam, bool melee_attack::decapitate_hydra(int dam, int damage_type) { - if (defender->id() == MONS_HYDRA) + if (defender->atype() == ACT_MONSTER && def->has_hydra_multi_attack()) { const int dam_type = (damage_type != -1) ? damage_type : attacker->damage_type(); @@ -3723,7 +3727,7 @@ void melee_attack::mons_apply_attack_flavour(const mon_attack_def &attk) void melee_attack::mons_perform_attack_rounds() { - const int nrounds = atk->type == MONS_HYDRA? atk->number : 4; + const int nrounds = atk->has_hydra_multi_attack()? atk->number : 4; const coord_def pos = defender->pos(); // Melee combat, tell attacker to wield its melee weapon. |