diff options
author | Jude Brown <bookofjude@users.sourceforge.net> | 2009-11-08 14:27:41 +1000 |
---|---|---|
committer | Jude Brown <bookofjude@users.sourceforge.net> | 2009-11-08 14:30:55 +1000 |
commit | 5f88766c2ade9a2061cc477ef7d2cef4fb4af547 (patch) | |
tree | 31d61fc4461a696b8b9eb0b03699dc02ef78fa03 /crawl-ref/source/monstuff.cc | |
parent | 4915a3d61f5c92669121713d4744fb60036dac2f (diff) | |
download | crawl-ref-5f88766c2ade9a2061cc477ef7d2cef4fb4af547.tar.gz crawl-ref-5f88766c2ade9a2061cc477ef7d2cef4fb4af547.zip |
New unique: Pikel, the big kobold slaver.
Appears from D:4 through D:9, and comes with a band of human slaves.
They will turn neutral (and be pacified, granting 1/2 EXP) if you
destroy Pikel before destroying them. Pikel generates with a whip
(either flaming or pain), and a black robe.
The "pikel_band_neutralise()" function is quite hacky and assumes that
all MONS_HUMANS with MF_BAND_MEMBER are part of Pikel's band. This
should be changed as soon as there is a better way of tracking who is in
what band.
Diffstat (limited to 'crawl-ref/source/monstuff.cc')
-rw-r--r-- | crawl-ref/source/monstuff.cc | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index a9eccfda1d..e237ec119c 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -1198,6 +1198,29 @@ void _monster_die_cloud(const monsters* monster, bool corpse, bool silent, } } +void pikel_band_neutralise () +{ + // XXX: This is a really ugly hack. It should be replaced by something else + // when band tracking is available. This assumes that the only human monsters + // with MF_BAND_MEMBER are Pikel's band members. + bool message_made = false; + + for (int i = 0; i < MAX_MONSTERS; ++i) + { + monsters *monster = &menv[i]; + if (monster->alive() && monster->type == MONS_HUMAN + && testbits(monster->flags, MF_BAND_MEMBER)) + { + if (monster->observable() && !message_made) + { + mpr("Pikel's slaves thank you for their freedom."); + message_made = true; + } + mons_pacify(monster); + } + } +} + static void _hogs_to_humans() { // Simplification: if, in a rare event, another hog which was not created @@ -1990,6 +2013,12 @@ int monster_die(monsters *monster, killer_type killer, { _hogs_to_humans(); } + else if (monster->type == MONS_PIKEL) + { + // His slaves don't care if he's dead or not, just whether or not + // he goes away. + pikel_band_neutralise(); + } else if (monster->type == MONS_KRAKEN) { if (_destroy_tentacles(monster) && !in_transit) |