From db86b7751c82969f85be99ea9becc6717357875f Mon Sep 17 00:00:00 2001 From: dshaligram Date: Fri, 25 Jan 2008 07:24:40 +0000 Subject: [1878126] Suppress " goes berserk" messages for Trog punishment, fixed enchantment name assert. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3327 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/enum.h | 7 +++++-- crawl-ref/source/mon-util.cc | 2 +- crawl-ref/source/religion.cc | 32 ++++++++++++++++++-------------- 3 files changed, 24 insertions(+), 17 deletions(-) (limited to 'crawl-ref') diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h index fd5f87287d..fbfb3181b1 100644 --- a/crawl-ref/source/enum.h +++ b/crawl-ref/source/enum.h @@ -1093,7 +1093,8 @@ enum duration_type NUM_DURATIONS }; -// This list must match the enchant_names array in mon-util.cc +// This list must match the enchant_names array in mon-util.cc or Crawl +// will CRASH, we kid you not. enum enchant_type { ENCH_NONE = 0, // 0 @@ -1123,7 +1124,9 @@ enum enchant_type ENCH_HELD, // caught in a net ENCH_BATTLE_FRENZY, // Monster is in a battle frenzy ENCH_NEUTRAL, - + + // Update enchantment names in mon-util.cc when adding or removing + // enchantments. NUM_ENCHANTMENTS }; diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index aeb0c84bba..5d7a21c285 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -5162,7 +5162,7 @@ static const char *enchant_names[] = "rot", "summon", "abj", "backlit", "charm", "fire", "gloshifter", "shifter", "tp", "wary", "submerged", "short lived", "paralysis", "sick", "sleep", "fatigue", "held", - "blood-lust", "bug" + "blood-lust", "neutral", "bug" }; const char *mons_enchantment_name(enchant_type ench) diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index 12ba52fc84..ea25b302fc 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -2284,29 +2284,33 @@ static bool trog_retribution() int count = 0; int points = 3 + you.experience_level * 3; - while (points > 0) { - int cost = random2(8) + 3; + no_messages msg; + + while (points > 0) + { + int cost = random2(8) + 3; - if (cost > points) - cost = points; + if (cost > points) + cost = points; - // quick reduction for large values - if (points > 20 && coinflip()) - { - points -= 10; - cost = 10; - } + // quick reduction for large values + if (points > 20 && coinflip()) + { + points -= 10; + cost = 10; + } - points -= cost; + points -= cost; - if (summon_berserker(cost * 20, false)) - count++; + if (summon_berserker(cost * 20, false)) + count++; + } } simple_god_message(count > 1 ? " sends monsters to punish you." : count > 0 ? " sends a monster to punish you." : - " has no time to punish you...now.", god); + " has no time to punish you... now.", god); } else if ( !one_chance_in(3) ) { -- cgit v1.2.3-54-g00ecf