summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-13 23:05:56 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-13 23:05:56 +0000
commit8d4516f8e47c12b8acc7736ed8f66d420795e3d5 (patch)
tree28c221f41b9778041cfaaa5c929a372942b7e010
parent51e9a455676bd4e59ccc2b0cd0854f129c26d92c (diff)
downloadcrawl-ref-8d4516f8e47c12b8acc7736ed8f66d420795e3d5.tar.gz
crawl-ref-8d4516f8e47c12b8acc7736ed8f66d420795e3d5.zip
Implement FR 1928421: let Snorg go berserk!
There's a flat 5% chance of Snorg going berserk each turn an enemy (you or an ally) is in sight. Once he is wounded, even if just by a scratch, that chance increases to 20% per turn. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5795 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/settings/messages.txt1
-rw-r--r--crawl-ref/source/dat/descript/monsters.txt2
-rw-r--r--crawl-ref/source/mon-util.cc2
-rw-r--r--crawl-ref/source/monstuff.cc16
4 files changed, 19 insertions, 2 deletions
diff --git a/crawl-ref/settings/messages.txt b/crawl-ref/settings/messages.txt
index 67856347fa..f21cca5b92 100644
--- a/crawl-ref/settings/messages.txt
+++ b/crawl-ref/settings/messages.txt
@@ -18,6 +18,7 @@ msc = lightred:Some of your food is covered with spores
msc = lightred:lose your buoyancy
msc = lightred:sense of stasis
msc = lightred:clumsily bash
+msc = lightred:goes berserk!
# Less urgent, but still significant messages
#
diff --git a/crawl-ref/source/dat/descript/monsters.txt b/crawl-ref/source/dat/descript/monsters.txt
index 40ef0c0cc1..b734722782 100644
--- a/crawl-ref/source/dat/descript/monsters.txt
+++ b/crawl-ref/source/dat/descript/monsters.txt
@@ -397,7 +397,7 @@ wields a nasty-looking scythe.
%%%%
Snorg
-A hairy troll.
+A hairy troll, angry and mean.
%%%%
Terence
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index 15ba6e9e30..0408932739 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -4273,7 +4273,7 @@ void monsters::attacking(actor * /* other */)
void monsters::go_berserk(bool /* intentional */)
{
- if ( !this->can_go_berserk() )
+ if (!this->can_go_berserk())
return;
if (has_ench(ENCH_SLOW))
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index 8fdd3ac17c..43cd32987d 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -3907,6 +3907,22 @@ static bool _handle_special_ability(monsters *monster, bolt & beem)
used = moth_incite_monsters(monster);
break;
+ case MONS_SNORG:
+ if (monster->has_ench(ENCH_CONFUSION))
+ break;
+
+ if (monster->foe == MHITNOT)
+ break;
+
+ // There's a 5% chance of Snorg spontaneously going berserk that
+ // increases to 20% once Snorg is wounded.
+ if (monster->hit_points == monster->max_hit_points && !one_chance_in(4))
+ break;
+
+ if (one_chance_in(5))
+ monster->go_berserk(true);
+ break;
+
case MONS_PIT_FIEND:
if (one_chance_in(3))
break;