summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-01-25 07:24:40 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-01-25 07:24:40 +0000
commitdb86b7751c82969f85be99ea9becc6717357875f (patch)
tree9377353d4d4e0993ddf28a2bef003cf7b7df0adc /crawl-ref
parentc0d2b0bfbdb1d6737aa7cf76eb557994afc5972e (diff)
downloadcrawl-ref-db86b7751c82969f85be99ea9becc6717357875f.tar.gz
crawl-ref-db86b7751c82969f85be99ea9becc6717357875f.zip
[1878126] Suppress "<foo> 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
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/enum.h7
-rw-r--r--crawl-ref/source/mon-util.cc2
-rw-r--r--crawl-ref/source/religion.cc32
3 files changed, 24 insertions, 17 deletions
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) )
{