From 6fb017686eff6e1c5c90632e39ff2b71bb01ef8f Mon Sep 17 00:00:00 2001 From: Jude Brown Date: Sat, 14 Nov 2009 13:53:54 +1000 Subject: Clean up Pikel band code, name them "slaves", then "freed slaves". As per kilobyte's suggestion on c-r-d, Pikel's humans are named "slave" until they are released from bondage on Pikel's death, in which case they're called "freed slave". Also clean up the Pikel band neutralisation code: instead of assuming that all human monsters that are band members are Pikel's band, store a value in monsters.props that signifies them as such. --- crawl-ref/source/mon-place.cc | 6 ++++-- crawl-ref/source/mon-stuff.cc | 9 +++++---- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/mon-place.cc b/crawl-ref/source/mon-place.cc index d428474e49..4e8bde2885 100644 --- a/crawl-ref/source/mon-place.cc +++ b/crawl-ref/source/mon-place.cc @@ -1009,8 +1009,10 @@ int place_monster(mgen_data mg, bool force_pos) // Don't give XP for the slaves to discourage hunting. Pikel // has an artificially large XP modifier to compensate for // this. - - menv[band_id].flags |= MF_CREATED_FRIENDLY; + menv[band_id].flags |= MF_CREATED_FRIENDLY | MF_NAME_DESCRIPTOR + | MF_NAME_REPLACE; + menv[band_id].mname = "slave"; + menv[band_id].props["pikel_band"] = true; } } } diff --git a/crawl-ref/source/mon-stuff.cc b/crawl-ref/source/mon-stuff.cc index 4b0114d5ee..eff21048af 100644 --- a/crawl-ref/source/mon-stuff.cc +++ b/crawl-ref/source/mon-stuff.cc @@ -1162,21 +1162,22 @@ static void _elven_twin_died(monsters* twin) 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 (monster_iterator mi; mi; ++mi) { if (mi->type == MONS_HUMAN - && testbits(mi->flags, MF_BAND_MEMBER)) + && testbits(mi->flags, MF_BAND_MEMBER) + && mi->props.exists("pikel_band")) { if (mi->observable() && !message_made) { mpr("Pikel's slaves thank you for their freedom."); message_made = true; } + + mi->mname = "freed slave"; + // viewwindow(); mons_pacify(*mi); } } -- cgit v1.2.3-54-g00ecf