From 5f88766c2ade9a2061cc477ef7d2cef4fb4af547 Mon Sep 17 00:00:00 2001 From: Jude Brown Date: Sun, 8 Nov 2009 14:27:41 +1000 Subject: 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. --- crawl-ref/source/monstuff.cc | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'crawl-ref/source/monstuff.cc') 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) -- cgit v1.2.3-54-g00ecf