summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/ghost.cc
diff options
context:
space:
mode:
authorreaverb <reaverb.Crawl@gmail.com>2014-07-29 00:20:22 -0400
committerreaverb <reaverb.Crawl@gmail.com>2014-07-29 00:20:33 -0400
commit40608398c76981ed953c2cf73d9054163bfd79f7 (patch)
treea26b9711bc72ddec7b367ac043d92beefd64c84e /crawl-ref/source/ghost.cc
parent2a2eb70bb3361ac40c63b44d6d42c6ebfb54a018 (diff)
downloadcrawl-ref-40608398c76981ed953c2cf73d9054163bfd79f7.tar.gz
crawl-ref-40608398c76981ed953c2cf73d9054163bfd79f7.zip
Rearrange some pan lord generation code
Move the chance for the a pan lord to cast spells closer to the things it effects, etc.
Diffstat (limited to 'crawl-ref/source/ghost.cc')
-rw-r--r--crawl-ref/source/ghost.cc38
1 files changed, 19 insertions, 19 deletions
diff --git a/crawl-ref/source/ghost.cc b/crawl-ref/source/ghost.cc
index 14a500f9db..567412c1c1 100644
--- a/crawl-ref/source/ghost.cc
+++ b/crawl-ref/source/ghost.cc
@@ -182,10 +182,6 @@ void ghost_demon::init_random_demon()
ev = 5 + random2(20);
ac = 5 + random2(20);
- // Is demon a spellcaster?
- // Non-spellcasters get some boosts to their melee and speed instead.
- spellcaster = !one_chance_in(4);
-
see_invis = true;
resists = 0;
@@ -209,8 +205,17 @@ void ghost_demon::init_random_demon()
// HTH damage:
damage = 20 + roll_dice(2, 20);
- // special attack type (uses weapon brand code):
- brand = SPWPN_NORMAL;
+ // Does demon fly?
+ fly = (one_chance_in(3) ? FL_NONE :
+ one_chance_in(5) ? FL_LEVITATE
+ : FL_WINGED);
+
+ // hit dice:
+ xl = 10 + roll_dice(2, 10);
+
+ // Is demon a spellcaster?
+ // Non-spellcasters get branded melee attacks and are faster instead.
+ spellcaster = x_chance_in_y(3,4);
if (one_chance_in(3) || !spellcaster)
{
@@ -232,14 +237,8 @@ void ghost_demon::init_random_demon()
|| brand == SPWPN_EVASION
);
}
-
- // Does demon fly?
- fly = (one_chance_in(3) ? FL_NONE :
- one_chance_in(5) ? FL_LEVITATE
- : FL_WINGED);
-
- // hit dice:
- xl = 10 + roll_dice(2, 10);
+ else
+ brand = SPWPN_NORMAL;
// Non-caster demons are fast, casters may get haste.
if (!spellcaster)
@@ -249,11 +248,6 @@ void ghost_demon::init_random_demon()
else
speed = 8 + roll_dice(2,5);
- // Does demon cycle colours?
- cycle_colours = one_chance_in(10);
-
- colour = random_colour();
-
spells.init(SPELL_NO_SPELL);
// This bit uses the list of player spells to find appropriate
@@ -352,6 +346,12 @@ void ghost_demon::init_random_demon()
if (one_chance_in(15))
spells[4] = SPELL_DIG;
}
+
+ // Does demon cycle colours?
+ cycle_colours = one_chance_in(10);
+
+ colour = random_colour();
+
}
// Returns the movement speed for a player ghost. Note that this is a