From 00b182be477bb0999a03eab16deb4fc5dd210a6c Mon Sep 17 00:00:00 2001 From: dolorous Date: Sat, 19 Sep 2009 18:58:40 +0000 Subject: Make (very) ugly things no longer heal all damage when they mutate. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10734 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/externs.h | 2 +- crawl-ref/source/ghost.cc | 19 ++++++++++++------- crawl-ref/source/ghost.h | 2 +- crawl-ref/source/mon-util.cc | 16 +++++++++++----- 4 files changed, 25 insertions(+), 14 deletions(-) (limited to 'crawl-ref') diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h index 6c289d5727..df0fadf14d 100644 --- a/crawl-ref/source/externs.h +++ b/crawl-ref/source/externs.h @@ -1364,7 +1364,7 @@ public: void set_ghost(const ghost_demon &ghost, bool has_name = true); void ghost_init(); void pandemon_init(); - void uglything_init(); + void uglything_init(bool only_mutate = false); void uglything_mutate(); void uglything_upgrade(); void destroy_inventory(); diff --git a/crawl-ref/source/ghost.cc b/crawl-ref/source/ghost.cc index 29f8cb4970..aea2141319 100644 --- a/crawl-ref/source/ghost.cc +++ b/crawl-ref/source/ghost.cc @@ -475,7 +475,7 @@ static mon_attack_flavour _ugly_thing_flavour_upgrade(mon_attack_flavour u_att_f return (u_att_flav); } -void ghost_demon::init_ugly_thing(bool very_ugly, bool mutate) +void ghost_demon::init_ugly_thing(bool very_ugly, bool only_mutate) { // Midpoint: 10, as in mon-data.h. speed = 9 + random2(3); @@ -489,11 +489,16 @@ void ghost_demon::init_ugly_thing(bool very_ugly, bool mutate) // Midpoint: 12, as in mon-data.h. damage = 11 + random2(3); - // Experience level: 8, the same as in mon-data.h. - xl = 8; + // If we're mutating an ugly thing, leave its experience level, hit + // dice and hit points as they are. + if (!only_mutate) + { + // Experience level: 8, the same as in mon-data.h. + xl = 8; - // Hit dice: {8, 3, 5, 0}, the same as in mon-data.h. - max_hp = hit_points(xl, 3, 5); + // Hit dice: {8, 3, 5, 0}, the same as in mon-data.h. + max_hp = hit_points(xl, 3, 5); + } resists.elec = 0; resists.poison = 0; @@ -516,8 +521,8 @@ void ghost_demon::init_ugly_thing(bool very_ugly, bool mutate) // An ugly thing always gets a low-intensity colour. If we're // mutating it, it always gets a different colour from what it had // before. - colour = _ugly_thing_random_colour(mutate ? make_low_colour(colour) - : BLACK); + colour = _ugly_thing_random_colour(only_mutate ? make_low_colour(colour) + : BLACK); // Pick a compatible attack flavour for this colour. att_flav = _ugly_thing_colour_to_flavour(colour); diff --git a/crawl-ref/source/ghost.h b/crawl-ref/source/ghost.h index ab06a80954..d788c788aa 100644 --- a/crawl-ref/source/ghost.h +++ b/crawl-ref/source/ghost.h @@ -46,7 +46,7 @@ public: void reset(); void init_random_demon(); void init_player_ghost(); - void init_ugly_thing(bool very_ugly, bool mutate = false); + void init_ugly_thing(bool very_ugly, bool only_mutate = false); void ugly_thing_to_very_ugly_thing(); public: diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index 0ae62e5f7f..db42b1dc96 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -6338,11 +6338,17 @@ void monsters::ghost_init() find_place_to_live(); } -void monsters::uglything_init() +void monsters::uglything_init(bool only_mutate) { - hit_dice = ghost->xl; - hit_points = ghost->max_hp; - max_hit_points = ghost->max_hp; + // If we're mutating an ugly thing, leave its experience level, hit + // dice and hit points as they are. + if (!only_mutate) + { + hit_dice = ghost->xl; + hit_points = ghost->max_hp; + max_hit_points = ghost->max_hp; + } + ac = ghost->ac; ev = ghost->ev; speed = ghost->speed; @@ -6353,7 +6359,7 @@ void monsters::uglything_init() void monsters::uglything_mutate() { ghost->init_ugly_thing(type == MONS_VERY_UGLY_THING, true); - uglything_init(); + uglything_init(true); } void monsters::uglything_upgrade() -- cgit v1.2.3-54-g00ecf