summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells2.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-08-07 15:45:31 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-08-07 15:45:31 +0000
commitc07fe0536a4c606d80cf932c3f252036ac1e2394 (patch)
tree625f7cfa18493c3fcce26a55f2b29760725db592 /crawl-ref/source/spells2.cc
parenta6bf377cd3e2c858d28227aee2d03d73c4616862 (diff)
downloadcrawl-ref-c07fe0536a4c606d80cf932c3f252036ac1e2394.tar.gz
crawl-ref-c07fe0536a4c606d80cf932c3f252036ac1e2394.zip
Brothers-in-Arms set berserk dur = abjuration dur so the summon goes away
when the berserk wears off. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1977 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spells2.cc')
-rw-r--r--crawl-ref/source/spells2.cc76
1 files changed, 45 insertions, 31 deletions
diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc
index ed416a73a6..c69102550e 100644
--- a/crawl-ref/source/spells2.cc
+++ b/crawl-ref/source/spells2.cc
@@ -1422,58 +1422,72 @@ void summon_berserker()
int pow = you.piety + random2(you.piety/4) - random2(you.piety/4);
int numsc = std::min(2 + (random2(pow) / 4), 6);
- int mon = MONS_TROLL;
+ monster_type mon = MONS_TROLL;
if (pow <= 100)
- { // bears
- if (coinflip())
- mon = MONS_BLACK_BEAR;
- else
- mon = MONS_GRIZZLY_BEAR;
+ {
+ // bears
+ if (coinflip())
+ mon = MONS_BLACK_BEAR;
+ else
+ mon = MONS_GRIZZLY_BEAR;
}
else if (pow <= 140)
{
- // ogres
- if (one_chance_in(3))
- mon = MONS_TWO_HEADED_OGRE;
- else
- mon = MONS_OGRE;
+ // ogres
+ if (one_chance_in(3))
+ mon = MONS_TWO_HEADED_OGRE;
+ else
+ mon = MONS_OGRE;
}
else if (pow <= 180)
{
- // trolls
- switch(random2(8))
- {
+ // trolls
+ switch(random2(8))
+ {
case 0:
- mon = MONS_DEEP_TROLL;
- break;
+ mon = MONS_DEEP_TROLL;
+ break;
case 1:
case 2:
- mon = MONS_IRON_TROLL;
- break;
+ mon = MONS_IRON_TROLL;
+ break;
case 3:
case 4:
- mon = MONS_ROCK_TROLL;
- break;
+ mon = MONS_ROCK_TROLL;
+ break;
default:
- mon = MONS_TROLL;
- break;
- }
+ mon = MONS_TROLL;
+ break;
+ }
}
else
{
- // giants
- if (coinflip())
- mon = MONS_HILL_GIANT;
- else
- mon = MONS_STONE_GIANT;
+ // giants
+ if (coinflip())
+ mon = MONS_HILL_GIANT;
+ else
+ mon = MONS_STONE_GIANT;
}
- int mons = create_monster( mon, numsc, beha, you.x_pos, you.y_pos, MHITYOU, 250 );
+ int mons = create_monster( mon, numsc, beha, you.x_pos, you.y_pos,
+ MHITYOU, 250 );
if (mons != -1)
- menv[mons].go_berserk(false);
-
+ {
+ monsters *summon = &menv[mons];
+ summon->go_berserk(false);
+ mon_enchant berserk = summon->get_ench(ENCH_BERSERK);
+ mon_enchant abj = summon->get_ench(ENCH_ABJ);
+
+ // Let Trog gifts berserk longer, and set abj timeout ==
+ // berserk timeout.
+ berserk.duration *= 2;
+ berserk.maxduration = berserk.duration;
+ abj.duration = abj.maxduration = berserk.duration;
+ summon->update_ench(berserk);
+ summon->update_ench(abj);
+ }
} // end summon_berserker()
bool summon_swarm( int pow, bool unfriendly, bool god_gift )