From 3031fc6db1f969fd9b3bfa9687b263713cda20a0 Mon Sep 17 00:00:00 2001 From: Jude Brown Date: Thu, 12 Nov 2009 23:08:37 +1000 Subject: Rename can_sleep/put_to_sleep to can_hibernate/hibernate. This reflects the fact that these functions are currently only used to player and monster ensorcelled hibernation/metabolic englaciation, and thus both check monster's cold resistance. --- crawl-ref/source/actor.h | 4 ++-- crawl-ref/source/beam.cc | 8 ++++---- crawl-ref/source/delay.cc | 2 +- crawl-ref/source/godwrath.cc | 4 ++-- crawl-ref/source/mon-info.cc | 2 +- crawl-ref/source/monster.cc | 6 +++--- crawl-ref/source/monster.h | 4 ++-- crawl-ref/source/player.cc | 6 +++--- crawl-ref/source/player.h | 4 ++-- crawl-ref/source/spells4.cc | 4 ++-- 10 files changed, 22 insertions(+), 22 deletions(-) diff --git a/crawl-ref/source/actor.h b/crawl-ref/source/actor.h index 43ca3d25b8..10dd3f7bda 100644 --- a/crawl-ref/source/actor.h +++ b/crawl-ref/source/actor.h @@ -157,8 +157,8 @@ public: virtual void confuse(actor *attacker, int strength) = 0; virtual void expose_to_element(beam_type element, int strength = 0) = 0; virtual void drain_stat(int stat, int amount, actor* attacker) { } - virtual bool can_sleep(bool holi_only = false) const = 0; - virtual void put_to_sleep(int power = 0) = 0; + virtual bool can_hibernate(bool holi_only = false) const = 0; + virtual void hibernate(int power = 0) = 0; virtual void check_awaken(int disturbance) = 0; virtual bool wearing_light_armour(bool = false) const { return (true); } diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index 66bebe1642..864d38d439 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -3791,7 +3791,7 @@ void bolt::affect_player_enchantment() switch (flavour) { case BEAM_HIBERNATION: - you.put_to_sleep(ench_power); + you.hibernate(ench_power); break; case BEAM_CORONA: @@ -5008,7 +5008,7 @@ bool _ench_flavour_affects_monster(beam_type flavour, const monsters* mon) break; case BEAM_HIBERNATION: - rc = mon->can_sleep(); + rc = mon->can_hibernate(); break; case BEAM_PORKALATOR: @@ -5213,11 +5213,11 @@ mon_resist_type bolt::apply_enchantment_to_monster(monsters* mon) return (MON_AFFECTED); case BEAM_HIBERNATION: - if (mon->can_sleep()) + if (mon->can_hibernate()) { if (simple_monster_message(mon, " looks drowsy...")) obvious_effect = true; - mon->put_to_sleep(); + mon->hibernate(); return (MON_AFFECTED); } return (MON_UNAFFECTED); diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc index 85e7b6ea29..b05ca85380 100644 --- a/crawl-ref/source/delay.cc +++ b/crawl-ref/source/delay.cc @@ -165,7 +165,7 @@ static int _recite_to_monsters(coord_def where, int pow, int, actor *) case 6: case 7: case 8: - mon->put_to_sleep(); + mon->hibernate(); simple_monster_message(mon, " falls asleep!"); break; case 9: diff --git a/crawl-ref/source/godwrath.cc b/crawl-ref/source/godwrath.cc index 678b35a209..0408bb228c 100644 --- a/crawl-ref/source/godwrath.cc +++ b/crawl-ref/source/godwrath.cc @@ -235,7 +235,7 @@ static bool _zin_retribution() confuse_player(3 + random2(10), false); break; case 1: - you.put_to_sleep(); + you.hibernate(); break; case 2: you.paralyse(NULL, 3 + random2(10)); @@ -373,7 +373,7 @@ static bool _cheibriados_retribution() case 2: case 3: mpr("You lose track of time."); - you.put_to_sleep(); + you.hibernate(); break; case 4: diff --git a/crawl-ref/source/mon-info.cc b/crawl-ref/source/mon-info.cc index 55d47f1387..659aa1cb7d 100644 --- a/crawl-ref/source/mon-info.cc +++ b/crawl-ref/source/mon-info.cc @@ -166,7 +166,7 @@ static std::string _verbose_info(const monsters* m) return (" (fleeing)"); if (m->asleep()) { - if (!m->can_sleep(true)) + if (!m->can_hibernate(true)) return (" (dormant)"); else return (" (sleeping)"); diff --git a/crawl-ref/source/monster.cc b/crawl-ref/source/monster.cc index b2f42c18f9..143370cecf 100644 --- a/crawl-ref/source/monster.cc +++ b/crawl-ref/source/monster.cc @@ -5566,7 +5566,7 @@ bool monsters::do_shaft() return (reveal); } -bool monsters::can_sleep(bool holi_only) const +bool monsters::can_hibernate(bool holi_only) const { // Undead, nonliving, and plants don't sleep. const mon_holy_type holi = holiness(); @@ -5591,9 +5591,9 @@ bool monsters::can_sleep(bool holi_only) const return (true); } -void monsters::put_to_sleep(int) +void monsters::hibernate(int) { - if (!can_sleep()) + if (!can_hibernate()) return; behaviour = BEH_SLEEP; diff --git a/crawl-ref/source/monster.h b/crawl-ref/source/monster.h index 83e9f779d1..8725688d01 100644 --- a/crawl-ref/source/monster.h +++ b/crawl-ref/source/monster.h @@ -380,8 +380,8 @@ public: void blink(bool allow_partial_control = true); void teleport(bool right_now = false, bool abyss_shift = false); - bool can_sleep(bool holi_only = false) const; - void put_to_sleep(int power = 0); + bool can_hibernate(bool holi_only = false) const; + void hibernate(int power = 0); void check_awaken(int disturbance); int stat_hp() const { return hit_points; } diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 49d210f4ec..4ea7ac6b41 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -7038,7 +7038,7 @@ bool player::can_throw_large_rocks() const return (player_genus(GENPC_OGRE) || species == SP_TROLL); } -bool player::can_sleep(bool holi_only) const +bool player::can_hibernate(bool holi_only) const { // Undead, nonliving, and plants don't sleep. const mon_holy_type holi = holiness(); @@ -7059,11 +7059,11 @@ bool player::can_sleep(bool holi_only) const return (true); } -void player::put_to_sleep(int) +void player::hibernate(int) { ASSERT(!crawl_state.arena); - if (!can_sleep()) + if (!can_hibernate()) { mpr("You feel weary for a moment."); return; diff --git a/crawl-ref/source/player.h b/crawl-ref/source/player.h index 900d6bb52f..ebc18ba62f 100644 --- a/crawl-ref/source/player.h +++ b/crawl-ref/source/player.h @@ -473,8 +473,8 @@ public: bool petrified() const; bool asleep() const; - bool can_sleep(bool holi_only = false) const; - void put_to_sleep(int power = 0); + bool can_hibernate(bool holi_only = false) const; + void hibernate(int power = 0); void awake(); void check_awaken(int disturbance); diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc index 3458dc6671..86d344f25d 100644 --- a/crawl-ref/source/spells4.cc +++ b/crawl-ref/source/spells4.cc @@ -397,7 +397,7 @@ static int _sleep_monsters(coord_def where, int pow, int, actor *) if (!monster) return (0); - if (!monster->can_sleep(true)) + if (!monster->can_hibernate(true)) return (0); if (monster->check_res_magic(pow)) @@ -410,7 +410,7 @@ static int _sleep_monsters(coord_def where, int pow, int, actor *) if (monster->has_ench(ENCH_SLEEP_WARY) && !one_chance_in(3)) return (0); - monster->put_to_sleep(); + monster->hibernate(); monster->expose_to_element(BEAM_COLD, 2); return (1); } -- cgit v1.2.3-54-g00ecf