diff options
-rw-r--r-- | crawl-ref/source/actor.h | 7 | ||||
-rw-r--r-- | crawl-ref/source/attack.cc | 4 | ||||
-rw-r--r-- | crawl-ref/source/beam.cc | 8 | ||||
-rw-r--r-- | crawl-ref/source/itemname.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/monster.cc | 22 | ||||
-rw-r--r-- | crawl-ref/source/monster.h | 4 | ||||
-rw-r--r-- | crawl-ref/source/player.cc | 22 | ||||
-rw-r--r-- | crawl-ref/source/player.h | 4 |
8 files changed, 26 insertions, 47 deletions
diff --git a/crawl-ref/source/actor.h b/crawl-ref/source/actor.h index edbf24c717..6c3dda5bf6 100644 --- a/crawl-ref/source/actor.h +++ b/crawl-ref/source/actor.h @@ -342,15 +342,12 @@ public: virtual bool caught() const = 0; virtual bool asleep() const { return false; } - // check_haloed: include halo // self_halo: include own halo (actually if self_halo = false // and has a halo, returns false; so if you have a // halo you're not affected by others' halos for this // purpose) - virtual bool backlit(bool check_haloed = true, - bool self_halo = true) const = 0; - virtual bool umbra(bool check_haloed = true, - bool self_halo = true) const = 0; + virtual bool backlit(bool self_halo = true) const = 0; + virtual bool umbra() const = 0; // Within any actor's halo? virtual bool haloed() const; // Within an umbra? diff --git a/crawl-ref/source/attack.cc b/crawl-ref/source/attack.cc index cebd5f8305..dcbee6318e 100644 --- a/crawl-ref/source/attack.cc +++ b/crawl-ref/source/attack.cc @@ -301,10 +301,10 @@ int attack::calc_to_hit(bool random) mhit -= 5; } - if (defender->backlit(true, false)) + if (defender->backlit(false)) mhit += 2 + random2(8); else if (!attacker->nightvision() - && defender->umbra(true, true)) + && defender->umbra()) mhit -= 2 + random2(4); } // Don't delay doing this roll until test_hit(). diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index f06cc7dc43..1f9964eb17 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -3348,11 +3348,11 @@ bool bolt::misses_player() real_tohit /= 2; // Backlit is easier to hit: - if (you.backlit(true, false)) + if (you.backlit(false)) real_tohit += 2 + random2(8); // Umbra is harder to hit: - if (!nightvision && you.umbra(true, true)) + if (!nightvision && you.umbra()) real_tohit -= 2 + random2(4); } @@ -4908,11 +4908,11 @@ void bolt::affect_monster(monster* mon) beam_hit /= 2; // Backlit is easier to hit: - if (mon->backlit(true, false)) + if (mon->backlit(false)) beam_hit += 2 + random2(8); // Umbra is harder to hit: - if (!nightvision && mon->umbra(true, true)) + if (!nightvision && mon->umbra()) beam_hit -= 2 + random2(4); } diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc index 8ddad7b6cb..6a261fc0ab 100644 --- a/crawl-ref/source/itemname.cc +++ b/crawl-ref/source/itemname.cc @@ -3155,7 +3155,7 @@ bool is_dangerous_item(const item_def &item, bool temp) static bool _invisibility_is_useless(const bool temp) { // If you're Corona'd or a TSO-ite, this is always useless. - return temp ? you.backlit(true) + return temp ? you.backlit() : you.haloed() && you_worship(GOD_SHINING_ONE); } diff --git a/crawl-ref/source/monster.cc b/crawl-ref/source/monster.cc index a36d2f6f19..9ca842d9a0 100644 --- a/crawl-ref/source/monster.cc +++ b/crawl-ref/source/monster.cc @@ -3191,26 +3191,20 @@ bool monster::asleep() const return behaviour == BEH_SLEEP; } -bool monster::backlit(bool check_haloed, bool self_halo) const +bool monster::backlit(bool self_halo) const { - if (has_ench(ENCH_CORONA) || has_ench(ENCH_STICKY_FLAME) || has_ench(ENCH_SILVER_CORONA)) - return true; - if (check_haloed) + if (has_ench(ENCH_CORONA) || has_ench(ENCH_STICKY_FLAME) + || has_ench(ENCH_SILVER_CORONA)) { - return !umbraed() && haloed() && - (self_halo || halo_radius2() == -1); + return true; } - return false; + + return !umbraed() && haloed() && (self_halo || halo_radius2() == -1); } -bool monster::umbra(bool check_haloed, bool self_halo) const +bool monster::umbra() const { - if (check_haloed) - { - return umbraed() && !haloed() && - (self_halo || umbra_radius2() == -1); - } - return false; + return umbraed() && !haloed(); } bool monster::glows_naturally() const diff --git a/crawl-ref/source/monster.h b/crawl-ref/source/monster.h index 06a2bcb861..786fd1b8c8 100644 --- a/crawl-ref/source/monster.h +++ b/crawl-ref/source/monster.h @@ -383,8 +383,8 @@ public: bool confused_by_you() const; bool caught() const; bool asleep() const; - bool backlit(bool check_haloed = true, bool self_halo = true) const; - bool umbra(bool check_haloed = true, bool self_halo = true) const; + bool backlit(bool self_halo = true) const; + bool umbra() const; int halo_radius2() const; int silence_radius2() const; int liquefying_radius2() const; diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 9053caa19e..71443e47fa 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -7562,32 +7562,20 @@ bool player::visible_to(const actor *looker) const && (!invisible() || mon->can_see_invisible())); } -bool player::backlit(bool check_haloed, bool self_halo) const +bool player::backlit(bool self_halo) const { if (get_contamination_level() > 1 || duration[DUR_CORONA] || duration[DUR_LIQUID_FLAMES] || duration[DUR_QUAD_DAMAGE]) { return true; } - if (check_haloed) - { - return !umbraed() && haloed() - && (self_halo || halo_radius2() == -1); - } - return false; + + return !umbraed() && haloed() && (self_halo || halo_radius2() == -1); } -bool player::umbra(bool check_haloed, bool self_halo) const +bool player::umbra() const { - if (backlit()) - return false; - - if (check_haloed) - { - return umbraed() && !haloed() - && (self_halo || umbra_radius2() == -1); - } - return false; + return !backlit() && umbraed() && !haloed(); } bool player::glows_naturally() const diff --git a/crawl-ref/source/player.h b/crawl-ref/source/player.h index 3a2e05dafc..3d174c30c1 100644 --- a/crawl-ref/source/player.h +++ b/crawl-ref/source/player.h @@ -652,8 +652,8 @@ public: bool cannot_act() const; bool confused() const; bool caught() const; - bool backlit(bool check_haloed = true, bool self_halo = true) const; - bool umbra(bool check_haloed = true, bool self_halo = true) const; + bool backlit(bool self_halo = true) const; + bool umbra() const; int halo_radius2() const; int silence_radius2() const; int liquefying_radius2() const; |