From ee183b121218deff2df20e68d69f8220a32b9d8c Mon Sep 17 00:00:00 2001 From: Adam Borowski Date: Thu, 7 Jan 2010 23:09:38 +0100 Subject: Make unknown potions of rage override clarity. Drugs > being focused > anger. --- crawl-ref/source/actor.h | 2 +- crawl-ref/source/it_use2.cc | 2 +- crawl-ref/source/misc.cc | 4 ++-- crawl-ref/source/misc.h | 2 +- crawl-ref/source/monster.cc | 2 +- crawl-ref/source/monster.h | 2 +- crawl-ref/source/player.cc | 10 +++++----- crawl-ref/source/player.h | 4 ++-- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/crawl-ref/source/actor.h b/crawl-ref/source/actor.h index f429742e33..eba31bc031 100644 --- a/crawl-ref/source/actor.h +++ b/crawl-ref/source/actor.h @@ -151,7 +151,7 @@ public: virtual bool is_icy() const = 0; virtual bool is_fiery() const = 0; - virtual void go_berserk(bool intentional) = 0; + virtual void go_berserk(bool intentional, bool potion = false) = 0; virtual bool can_mutate() const = 0; virtual bool can_safely_mutate() const = 0; virtual bool can_bleed() const = 0; diff --git a/crawl-ref/source/it_use2.cc b/crawl-ref/source/it_use2.cc index 26326c1815..49371f2f80 100644 --- a/crawl-ref/source/it_use2.cc +++ b/crawl-ref/source/it_use2.cc @@ -409,7 +409,7 @@ bool potion_effect(potion_type pot_eff, int pow, bool drank_it, bool was_known) } else { - if (go_berserk(was_known)) + if (go_berserk(was_known, true)) xom_is_stimulated(64); } break; diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc index 515887c321..5b07af973f 100644 --- a/crawl-ref/source/misc.cc +++ b/crawl-ref/source/misc.cc @@ -2691,11 +2691,11 @@ bool scramble(void) return (true); } -bool go_berserk(bool intentional) +bool go_berserk(bool intentional, bool potion) { ASSERT(!crawl_state.arena); - if (!you.can_go_berserk(intentional)) + if (!you.can_go_berserk(intentional, potion)) return (false); if (Tutorial.tutorial_left) diff --git a/crawl-ref/source/misc.h b/crawl-ref/source/misc.h index 9b0eaa47a7..7bcf03715b 100644 --- a/crawl-ref/source/misc.h +++ b/crawl-ref/source/misc.h @@ -13,7 +13,7 @@ struct bolt; class dist; struct activity_interrupt_data; -bool go_berserk(bool intentional); +bool go_berserk(bool intentional, bool potion = false); void search_around(bool only_adjacent = false); void down_stairs(int old_level, dungeon_feature_type force_stair = DNGN_UNSEEN, diff --git a/crawl-ref/source/monster.cc b/crawl-ref/source/monster.cc index f541ccd0f4..d01d713bff 100644 --- a/crawl-ref/source/monster.cc +++ b/crawl-ref/source/monster.cc @@ -2762,7 +2762,7 @@ void monsters::go_frenzy() xom_is_stimulated(friendly() ? 32 : 128); } -void monsters::go_berserk(bool /* intentional */) +void monsters::go_berserk(bool /* intentional */, bool /* potion */) { if (!can_go_berserk()) return; diff --git a/crawl-ref/source/monster.h b/crawl-ref/source/monster.h index 28acc4a729..1da2bd21b3 100644 --- a/crawl-ref/source/monster.h +++ b/crawl-ref/source/monster.h @@ -295,7 +295,7 @@ public: void attacking(actor *other); bool can_go_berserk() const; - void go_berserk(bool intentional); + void go_berserk(bool intentional, bool potion = false); void go_frenzy(); bool berserk() const; bool frenzied() const; diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 52f577cc12..f5a0c2a852 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -5998,9 +5998,9 @@ void player::attacking(actor *other) } } -void player::go_berserk(bool intentional) +void player::go_berserk(bool intentional, bool potion) { - ::go_berserk(intentional); + ::go_berserk(intentional, potion); } bool player::can_go_berserk() const @@ -6008,9 +6008,9 @@ bool player::can_go_berserk() const return (can_go_berserk(false)); } -bool player::can_go_berserk(bool intentional) const +bool player::can_go_berserk(bool intentional, bool potion) const { - const bool verbose = intentional; + const bool verbose = intentional || potion; if (berserk()) { @@ -6046,7 +6046,7 @@ bool player::can_go_berserk(bool intentional) const return (false); } - if (!intentional && player_mental_clarity(true)) + if (!intentional && !potion && player_mental_clarity(true)) { if (verbose) { diff --git a/crawl-ref/source/player.h b/crawl-ref/source/player.h index babd15e4ad..ca1bb06bc2 100644 --- a/crawl-ref/source/player.h +++ b/crawl-ref/source/player.h @@ -419,8 +419,8 @@ public: void attacking(actor *other); bool can_go_berserk() const; - bool can_go_berserk(bool intentional) const; - void go_berserk(bool intentional); + bool can_go_berserk(bool intentional, bool potion = false) const; + void go_berserk(bool intentional, bool potion = false); bool berserk() const; bool can_mutate() const; bool can_safely_mutate() const; -- cgit v1.2.3-54-g00ecf