summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/misc.cc
diff options
context:
space:
mode:
authorNicholas Feinberg <pleasingfung@gmail.com>2014-06-04 22:54:07 -0700
committerNicholas Feinberg <pleasingfung@gmail.com>2014-06-04 22:54:07 -0700
commit4e359b6150a2b2f3201f52ffc1ea586a5c2d0a2a (patch)
treecb56385872922f49cdd538efa5ce6c562ef111d6 /crawl-ref/source/misc.cc
parent6f0af88fe662aaa218d7d1bb35a4fa2f54ed3e01 (diff)
downloadcrawl-ref-4e359b6150a2b2f3201f52ffc1ea586a5c2d0a2a.tar.gz
crawl-ref-4e359b6150a2b2f3201f52ffc1ea586a5c2d0a2a.zip
Move go_berserk() out of misc.cc
Diffstat (limited to 'crawl-ref/source/misc.cc')
-rw-r--r--crawl-ref/source/misc.cc109
1 files changed, 0 insertions, 109 deletions
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc
index db1b0f5b07..7cb14b0a77 100644
--- a/crawl-ref/source/misc.cc
+++ b/crawl-ref/source/misc.cc
@@ -1286,115 +1286,6 @@ string weird_sound()
return getMiscString("sound_name");
}
-/**
- * Check to see if Chei slows down the berserking player.
- * @param intentional If true, this was initiated by the player, and additional
- * messages can be printed if we can't berserk.
- * @return True if Chei will slow the player, false otherwise.
- */
-static bool _chei_prevents_berserk_haste(bool intentional)
-{
- if (!you_worship(GOD_CHEIBRIADOS))
- return false;
-
- // Chei makes berserk not speed you up.
- // Unintentional would be forgiven "just this once" every time.
- // Intentional could work as normal, but that would require storing
- // whether you transgressed to start it -- so we just consider this
- // a part of your penance.
- if (!intentional)
- {
- simple_god_message(" protects you from inadvertent hurry.");
- return true;
- }
-
- did_god_conduct(DID_HASTY, 8);
- // Let's see if you've lost your religion...
- if (!you_worship(GOD_CHEIBRIADOS))
- return false;
-
- simple_god_message(" forces you to slow down.");
- return true;
-}
-
-/**
- * Make the player go berserk!
- * @param intentional If true, this was initiated by the player, and additional
- * messages can be printed if we can't berserk.
- * @param potion If true, this was caused by the player quaffing !berserk;
- * and we get the same additional messages as when
- * intentional is true.
- * @returns True if we went berserk, false otherwise.
- */
-bool go_berserk(bool intentional, bool potion)
-{
- ASSERT(!crawl_state.game_is_arena());
-
- if (!you.can_go_berserk(intentional, potion))
- return false;
-
- if (stasis_blocks_effect(true,
- "%s thrums violently and saps your rage.",
- 3,
- "%s vibrates violently and saps your rage."))
- {
- return false;
- }
-
- if (crawl_state.game_is_hints())
- Hints.hints_berserk_counter++;
-
- mpr("A red film seems to cover your vision as you go berserk!");
-
- if (you.duration[DUR_FINESSE] > 0)
- {
- you.duration[DUR_FINESSE] = 0; // Totally incompatible.
- mpr("Finesse? Hah! Time to rip out guts!");
- }
-
- if (!_chei_prevents_berserk_haste(intentional))
- mpr("You feel yourself moving faster!");
-
- mpr("You feel mighty!");
-
- // Cutting the duration in half since berserk causes haste and hasted
- // actions have half the usual delay. This keeps player turns
- // approximately consistent withe previous versions. -cao
- // Only 1.5 now, but I'm keeping the reduction as a nerf. -1KB
- int berserk_duration = (20 + random2avg(19,2)) / 2;
-
- you.increase_duration(DUR_BERSERK, berserk_duration);
-
- calc_hp();
- set_hp(you.hp * 3 / 2);
-
- deflate_hp(you.hp_max, false);
-
- if (!you.duration[DUR_MIGHT])
- notify_stat_change(STAT_STR, 5, true, "going berserk");
-
- if (you.berserk_penalty != NO_BERSERK_PENALTY)
- you.berserk_penalty = 0;
-
- you.redraw_quiver = true; // Account for no firing.
-
-#if TAG_MAJOR_VERSION == 34
- if (you.species == SP_LAVA_ORC)
- {
- mpr("You burn with rage!");
- // This will get sqrt'd later, so.
- you.temperature = TEMP_MAX;
- }
-#endif
-
- if (player_equip_unrand(UNRAND_JIHAD))
- for (monster_near_iterator mi(you.pos(), LOS_NO_TRANS); mi; ++mi)
- if (mi->friendly())
- mi->go_berserk(false);
-
- return true;
-}
-
// HACK ALERT: In the following several functions, want_move is true if the
// player is travelling. If that is the case, things must be considered one
// square closer to the player, since we don't yet know where the player will