summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-grow.cc
diff options
context:
space:
mode:
authorShmuale Mark <shm.mark@gmail.com>2014-05-05 15:25:54 -0400
committerShmuale Mark <shm.mark@gmail.com>2014-05-05 17:47:55 -0400
commit8b0589b2b84b012d14d5e95f6c54ddbcd71c88db (patch)
treed2501fbbc2376baf10f01825c926d1b4e1c086b6 /crawl-ref/source/mon-grow.cc
parentc329b0c705123b0f95d8a861eb7388c726bd5c44 (diff)
downloadcrawl-ref-8b0589b2b84b012d14d5e95f6c54ddbcd71c88db.tar.gz
crawl-ref-8b0589b2b84b012d14d5e95f6c54ddbcd71c88db.zip
Let draconians grow up.
They will now be able to mature into whatever drac type they can (i.e. white scorchers will still be disallowed) upon reaching the appropriate HD. The goal is mostly to make draconian mercenaries more attractive, since if they can survive they can become rather strong.
Diffstat (limited to 'crawl-ref/source/mon-grow.cc')
-rw-r--r--crawl-ref/source/mon-grow.cc18
1 files changed, 13 insertions, 5 deletions
diff --git a/crawl-ref/source/mon-grow.cc b/crawl-ref/source/mon-grow.cc
index 63e75cdf9c..0a3ae59e7a 100644
--- a/crawl-ref/source/mon-grow.cc
+++ b/crawl-ref/source/mon-grow.cc
@@ -97,14 +97,19 @@ static const monster_level_up *_monster_level_up_target(monster_type type,
{
for (unsigned i = 0; i < ARRAYSZ(mon_grow); ++i)
{
- const monster_level_up &mlup(mon_grow[i]);
- if (mlup.before == type)
+ const monster_level_up *mlup = &mon_grow[i];
+ // XXX: A hack to let draconians level up wihout specifying every
+ // single possible combination.
+ bool upgrade_drac = mons_is_base_draconian(type);
+ if (mlup->before == type || upgrade_drac)
{
- const monsterentry *me = get_monster_data(mlup.after);
+ if (upgrade_drac)
+ mlup = new monster_level_up(type, resolve_monster_type(RANDOM_NONBASE_DRACONIAN, type));
+ const monsterentry *me = get_monster_data(mlup->after);
if (static_cast<int>(me->hpdice[0]) == hit_dice
- && x_chance_in_y(mlup.chance, 1000))
+ && x_chance_in_y(mlup->chance, 1000))
{
- return &mlup;
+ return mlup;
}
}
}
@@ -114,6 +119,9 @@ static const monster_level_up *_monster_level_up_target(monster_type type,
void monster::upgrade_type(monster_type after, bool adjust_hd,
bool adjust_hp)
{
+ // Needed for draconians growing into non-base ones.
+ base_monster = type;
+
const monsterentry *orig = get_monster_data(type);
// Ta-da!
type = after;