summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authorJohanna Ploog <j-p-e-g@users.sourceforge.net>2010-01-14 12:43:27 +0100
committerJohanna Ploog <j-p-e-g@users.sourceforge.net>2010-01-14 12:48:15 +0100
commit798300e2d76e0ab9aef0f224bc103b564c85f76a (patch)
treecda0ef08fe54263f7da2579de333c9de430cdcb9 /crawl-ref
parentf926d0bc381582d8134859bc873d9154ed1050a9 (diff)
downloadcrawl-ref-798300e2d76e0ab9aef0f224bc103b564c85f76a.tar.gz
crawl-ref-798300e2d76e0ab9aef0f224bc103b564c85f76a.zip
When the slave monster is placed, sometimes make it use the new tile.
This should lead to a more flavourful look of Pikel's slave band.
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/mon-place.cc19
1 files changed, 16 insertions, 3 deletions
diff --git a/crawl-ref/source/mon-place.cc b/crawl-ref/source/mon-place.cc
index 770d743cc7..331071bfcc 100644
--- a/crawl-ref/source/mon-place.cc
+++ b/crawl-ref/source/mon-place.cc
@@ -40,6 +40,9 @@
#include "traps.h"
#include "travel.h"
#include "view.h"
+#ifdef USE_TILE
+#include "tiledef-player.h"
+#endif
band_type active_monster_band = BAND_NO_BAND;
@@ -1128,6 +1131,15 @@ static int _place_monster_aux(const mgen_data &mg,
}
else if (mon->type == MONS_MERGED_SLIME_CREATURE) // shouldn't ever happen
mon->type = MONS_SLIME_CREATURE;
+#ifdef USE_TILE
+ else if (mon->type == MONS_SLAVE && !mon->props.exists("monster_tile")
+ && coinflip())
+ {
+ // When placing the slave monster, there's a 50% chance the
+ // default tile is replaced with an alternative one.
+ mon->props["monster_tile"] = short(TILEP_MONS_SLAVE_SMALL);
+ }
+#endif
// Generate a brand shiny new monster, or zombie.
if (mons_class_is_zombified(mg.cls))
@@ -2600,9 +2612,10 @@ int mons_place(mgen_data mg)
}
if (mg.behaviour == BEH_COPY)
- mg.behaviour = mg.summoner == &you
- ? BEH_FRIENDLY
- : SAME_ATTITUDE((&menv[mg.summoner->mindex()]));
+ {
+ mg.behaviour = (mg.summoner == &you) ? BEH_FRIENDLY
+ : SAME_ATTITUDE((&menv[mg.summoner->mindex()]));
+ }
int mid = place_monster(mg);
if (mid == -1)