summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-place.cc
diff options
context:
space:
mode:
authorJude Brown <bookofjude@users.sourceforge.net>2009-11-27 22:44:12 +1000
committerJude Brown <bookofjude@users.sourceforge.net>2009-11-27 22:44:12 +1000
commitb5068662183d41698414e728f64579bf3544cbaa (patch)
tree563664592e63eac18637cf5aab8c4d7426a76b93 /crawl-ref/source/mon-place.cc
parent1f6a372b1d013ce9068bee8c175fb7c11c28de5e (diff)
downloadcrawl-ref-b5068662183d41698414e728f64579bf3544cbaa.tar.gz
crawl-ref-b5068662183d41698414e728f64579bf3544cbaa.zip
New tags for monster specs: "hd" and "hp". (kilobyte)
Both values override the default class values. Placing "rat hd:20" will generate a rat with a hit dice of 20, while placing "rat hp:20" will set its hp to 20.
Diffstat (limited to 'crawl-ref/source/mon-place.cc')
-rw-r--r--crawl-ref/source/mon-place.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/crawl-ref/source/mon-place.cc b/crawl-ref/source/mon-place.cc
index dbfad61e5c..749489cf30 100644
--- a/crawl-ref/source/mon-place.cc
+++ b/crawl-ref/source/mon-place.cc
@@ -1154,6 +1154,15 @@ static int _place_monster_aux(const mgen_data &mg,
if (mg.mname != "")
mon->mname = mg.mname;
+ if (mg.hd != 0)
+ mon->hit_dice = mg.hd;
+
+ if (mg.hp != 0)
+ {
+ mon->max_hit_points = mg.hp;
+ mon->hit_points = mg.hp;
+ }
+
// The return of Boris is now handled in monster_die(). Not setting
// this for Boris here allows for multiple Borises in the dungeon at
// the same time. - bwr