From 100d0a3c9501882904c8d467bdd91bd43bec2d4f Mon Sep 17 00:00:00 2001 From: dolorous Date: Fri, 7 Nov 2008 21:37:34 +0000 Subject: Add more minor cosmetic fixes. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7408 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/beam.cc | 6 +++--- crawl-ref/source/mon-util.cc | 18 ++++++++++-------- crawl-ref/source/mon-util.h | 2 +- crawl-ref/source/player.cc | 32 ++++++++++++++++---------------- 4 files changed, 30 insertions(+), 28 deletions(-) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index 16219a9adc..34e0e4073d 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -2373,10 +2373,10 @@ static void _beam_petrifies_monster(bolt &pbolt, monsters *monster) bool curare_hits_monster(const bolt &beam, monsters *monster, kill_category who, int levels) { - const bool res_poison = mons_res_poison(monster) > 0; - poison_monster(monster, who, levels, false); + const bool res_poison = mons_res_poison(monster) > 0; + if (!mons_res_asphyx(monster)) { int hurted = roll_dice(2, 6); @@ -2409,7 +2409,7 @@ bool poison_monster(monsters *monster, kill_category who, int levels, if (!monster->alive()) return (false); - if (levels <= 0 || (!force && mons_res_poison(monster) > 0)) + if ((!force && mons_res_poison(monster) > 0) || levels <= 0) return (false); const mon_enchant old_pois = monster->get_ench(ENCH_POISON); diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index 381af53734..2c308fc40b 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -1209,10 +1209,12 @@ int mons_res_poison(const monsters *mon) return (u); } -bool mons_res_sticky_flame(const monsters *mon) +int mons_res_sticky_flame(const monsters *mon) { - return (get_mons_resists(mon).sticky_flame - || mon->has_equipped(EQ_BODY_ARMOUR, ARM_MOTTLED_DRAGON_ARMOUR)); + int res = get_mons_resists(mon).sticky_flame; + if (mon->has_equipped(EQ_BODY_ARMOUR, ARM_MOTTLED_DRAGON_ARMOUR)) + res += 3; + return (res); } int mons_res_steam(const monsters *mon) @@ -5086,11 +5088,6 @@ int monsters::res_fire() const return (mons_res_fire(this)); } -int monsters::res_sticky_flame() const -{ - return (mons_res_sticky_flame(this)); -} - int monsters::res_steam() const { return (mons_res_steam(this)); @@ -5111,6 +5108,11 @@ int monsters::res_poison() const return (mons_res_poison(this)); } +int monsters::res_sticky_flame() const +{ + return (mons_res_sticky_flame(this)); +} + int monsters::res_negative_energy() const { return (mons_res_negative_energy(this)); diff --git a/crawl-ref/source/mon-util.h b/crawl-ref/source/mon-util.h index e4df5ddd19..4152981761 100644 --- a/crawl-ref/source/mon-util.h +++ b/crawl-ref/source/mon-util.h @@ -561,12 +561,12 @@ habitat_type mons_secondary_habitat(const monsters *mon); bool intelligent_ally(const monsters *mon); -bool mons_res_sticky_flame(const monsters *mon); int mons_res_cold(const monsters *mon); int mons_res_elec(const monsters *mon); int mons_res_fire(const monsters *mon); int mons_res_steam(const monsters *mon); int mons_res_poison(const monsters *mon); +int mons_res_sticky_flame(const monsters *mon); int mons_res_acid(const monsters *mon); int mons_res_negative_energy(const monsters *mon); int mons_res_miasma(const monsters *mon); diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 9cf81785db..8e8f8e8ae7 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -1284,22 +1284,6 @@ int player_res_fire(bool calc_unid, bool temp, bool items) return (rf); } -int player_res_sticky_flame(bool calc_unid, bool temp, bool items) -{ - int res = 0; - - if (you.species == SP_MOTTLED_DRACONIAN && you.experience_level > 5) - res++; - - if (items && player_equip(EQ_BODY_ARMOUR, ARM_MOTTLED_DRAGON_ARMOUR)) - res++; - - if (res > 1) - res = 1; - - return (res); -} - int player_res_steam(bool calc_unid, bool temp, bool items) { int res = 0; @@ -1574,6 +1558,22 @@ int player_res_poison(bool calc_unid, bool temp, bool items) return (rp); } +int player_res_sticky_flame(bool calc_unid, bool temp, bool items) +{ + int rsf = 0; + + if (you.species == SP_MOTTLED_DRACONIAN && you.experience_level > 5) + rsf++; + + if (items && player_equip(EQ_BODY_ARMOUR, ARM_MOTTLED_DRAGON_ARMOUR)) + rsf++; + + if (rsf > 1) + rsf = 1; + + return (rsf); +} + int player_spec_death() { int sd = 0; -- cgit v1.2.3-54-g00ecf