From c2828b086fcebd014d25b64a34bd118db2021bd4 Mon Sep 17 00:00:00 2001 From: dolorous Date: Tue, 8 Apr 2008 03:11:37 +0000 Subject: Make attacks on paralyzed monsters count as stabbing. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4125 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/beam.cc | 18 +++++++++--------- crawl-ref/source/fight.cc | 16 ++++++++++++---- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index b988ded16e..47d7b07725 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -362,9 +362,9 @@ static void _zappy( zap_type z_type, int power, bolt &pbolt ) // level 2/3 // - // The following examples should make it clear that in the - // early game this cap is only limiting to serious spellcasters - // (they could easily reach the 20-10-0 example). + // The following examples should make it clear that in the + // early game this cap is only limiting to serious spellcasters + // (they could easily reach the 20-10-0 example). // // Example characters with about 50 power: // @@ -430,7 +430,7 @@ static void _zappy( zap_type z_type, int power, bolt &pbolt ) // // - int 15, skills 27, 3 enhancers (actually, only 146) // - int 20, skills 27, 2 enhancers (actually, only 137) - // - int 20, skills 21, 3 enhancers + // - int 20, skills 21, 3 enhancers // - int 25, skills 26, 2 enhancers // - int 30, skills 21, 2 enhancers // - int 40, skills 24, 1 enhancer @@ -1728,7 +1728,7 @@ int mons_adjust_flavoured( monsters *monster, bolt &pbolt, { simple_monster_message( monster, " partially resists." ); - // Poison arrow can poison any living thing regardless of + // Poison arrow can poison any living thing regardless of // poison resistance. -- bwr if (mons_has_lifeforce(monster)) poison_monster( monster, _whose_kill(pbolt), 2, true ); @@ -3582,7 +3582,7 @@ static int _affect_player( bolt &beam ) // poisoning if (beam.name.find("poisoned") != std::string::npos - && beam.flavour != BEAM_POISON + && beam.flavour != BEAM_POISON && beam.flavour != BEAM_POISON_ARROW && !player_res_poison()) { @@ -3669,7 +3669,7 @@ static int _affect_player( bolt &beam ) static int _beam_source(const bolt &beam) { - return MON_KILL(beam.thrower) ? beam.beam_source : + return MON_KILL(beam.thrower) ? beam.beam_source : beam.thrower == KILL_MISC ? MHITNOT : MHITYOU; } @@ -4344,14 +4344,14 @@ static int _affect_monster_enchantment(bolt &beam, monsters *mon) mon->attitude = ATT_FRIENDLY; else mon->add_ench(ENCH_CHARM); - + // break fleeing and suchlike mon->behaviour = BEH_SEEK; return (MON_AFFECTED); } // - // Everything past this point must pass this magic resistance test. + // Everything past this point must pass this magic resistance test. // // Using check_mons_resist_magic here since things like disintegrate // are beyond this point. -- bwr diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index 998a3147e4..a57e4ec095 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -1390,7 +1390,7 @@ int melee_attack::player_stab_weapon_bonus(int damage) bonus /= 2; bonus = stepdown_value( bonus, 10, 10, 30, 30 ); - + damage += bonus; } // fall through @@ -1433,14 +1433,14 @@ int melee_attack::player_stab(int damage) // lets make sure we have some damage to work with... if (damage < 1) damage = 1; - + if (def->behaviour == BEH_SLEEP) { // Sleeping moster wakes up when stabbed but may be groggy if (random2(200) <= you.skills[SK_STABBING] + you.dex) { int stun = random2( you.dex + 1 ); - + if (def->speed_increment > stun) def->speed_increment -= stun; else @@ -2748,7 +2748,7 @@ void melee_attack::player_stab_check() } // confused (but not perma-confused) - if (def->has_ench(ENCH_CONFUSION) + if (def->has_ench(ENCH_CONFUSION) && !mons_class_flag(def->type, M_CONFUSED)) { stab_attempt = true; @@ -2770,6 +2770,14 @@ void melee_attack::player_stab_check() stab_bonus = 2; } + // paralysed + if (def->has_ench(ENCH_PARALYSIS)) + { + stab_attempt = true; + roll_needed = false; + stab_bonus = 1; + } + // sleeping if (def->behaviour == BEH_SLEEP) { -- cgit v1.2.3-54-g00ecf