summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/describe.cc13
-rw-r--r--crawl-ref/source/mon-place.cc41
-rw-r--r--crawl-ref/source/monster.cc2
3 files changed, 56 insertions, 0 deletions
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc
index def7925150..426cba067f 100644
--- a/crawl-ref/source/describe.cc
+++ b/crawl-ref/source/describe.cc
@@ -2952,6 +2952,19 @@ void get_monster_db_desc(const monsters& mons, describe_info &inf,
<< mitm[mons.inv[i]].name(DESC_NOCAP_A, false, true);
}
}
+
+ if (mons.props.exists("blame"))
+ {
+ inf.body << "$$Monster blame chain:$";
+
+ const CrawlVector& blame = mons.props["blame"].get_vector();
+
+ for (CrawlVector::const_iterator it = blame.begin();
+ it != blame.end(); ++it)
+ {
+ inf.body << " " << it->get_string() << "$";
+ }
+ }
#endif
}
diff --git a/crawl-ref/source/mon-place.cc b/crawl-ref/source/mon-place.cc
index 12c9aac3e6..c326c359d8 100644
--- a/crawl-ref/source/mon-place.cc
+++ b/crawl-ref/source/mon-place.cc
@@ -1270,6 +1270,42 @@ static int _place_monster_aux(const mgen_data &mg,
}
mon->foe = mg.foe;
+ if (!mg.non_actor_summoner.empty())
+ {
+ CrawlStoreValue& blame = mon->props["blame"];
+
+ blame.new_vector(SV_STR, SFLAG_CONST_TYPE);
+ blame.get_vector().push_back(mg.non_actor_summoner);
+ }
+ else if (mg.summoner != NULL)
+ {
+ CrawlStoreValue& blame = mon->props["blame"];
+
+ blame.new_vector(SV_STR, SFLAG_CONST_TYPE);
+
+ if (mg.summoner->atype() == ACT_PLAYER)
+ {
+ blame.get_vector().push_back("themselves");
+ }
+ else
+ {
+ monsters* sum = &menv[mg.summoner->mindex()];
+
+ blame.get_vector().push_back(sum->full_name(DESC_NOCAP_A, true));
+
+ if (sum->props.exists("blame"))
+ {
+ CrawlVector& oldblame = sum->props["blame"].get_vector();
+
+ for (CrawlVector::iterator i = oldblame.begin();
+ i != oldblame.end(); ++i)
+ {
+ blame.get_vector().push_back(*i);
+ }
+ }
+ }
+ }
+
// Initialise (very) ugly things and pandemonium demons.
if (mon->type == MONS_UGLY_THING
|| mon->type == MONS_VERY_UGLY_THING)
@@ -2408,6 +2444,11 @@ int mons_place(mgen_data mg)
break;
}
+ if (mg.behaviour == BEH_COPY)
+ mg.behaviour = mg.summoner == &you
+ ? BEH_FRIENDLY
+ : SAME_ATTITUDE((&menv[mg.summoner->mindex()]));
+
int mid = place_monster(mg);
if (mid == -1)
return (-1);
diff --git a/crawl-ref/source/monster.cc b/crawl-ref/source/monster.cc
index 143370cecf..29d192cfd3 100644
--- a/crawl-ref/source/monster.cc
+++ b/crawl-ref/source/monster.cc
@@ -105,6 +105,7 @@ void monsters::reset()
travel_path.clear();
ghost.reset(NULL);
seen_context = "";
+ props.clear();
}
void monsters::init_with(const monsters &mon)
@@ -136,6 +137,7 @@ void monsters::init_with(const monsters &mon)
colour = mon.colour;
foe_memory = mon.foe_memory;
god = mon.god;
+ props = mon.props;
if (mon.ghost.get())
ghost.reset(new ghost_demon(*mon.ghost));