forked from github/server
dragon evolution gives full hitpoints.
This commit is contained in:
parent
ea1bf3d3b9
commit
f1c27f09e3
|
@ -30,23 +30,23 @@ static int age_chance(int a, int b, int p) {
|
|||
#define DRAGONAGE 27
|
||||
#define WYRMAGE 68
|
||||
|
||||
static void evolve_dragon(unit * u, const struct race *rc) {
|
||||
scale_number(u, 1);
|
||||
u_setrace(u, rc);
|
||||
u->irace = NULL;
|
||||
u->hp = unit_max_hp(u);
|
||||
}
|
||||
|
||||
void age_firedragon(unit * u)
|
||||
{
|
||||
if (u->number > 0 && rng_int() % 100 < age_chance(u->age, DRAGONAGE, 1)) {
|
||||
double q = (double)u->hp / (double)(unit_max_hp(u) * u->number);
|
||||
u_setrace(u, get_race(RC_DRAGON));
|
||||
u->irace = NULL;
|
||||
scale_number(u, 1);
|
||||
u->hp = (int)(unit_max_hp(u) * u->number * q);
|
||||
evolve_dragon(u, get_race(RC_DRAGON));
|
||||
}
|
||||
}
|
||||
|
||||
void age_dragon(unit * u)
|
||||
{
|
||||
if (u->number > 0 && rng_int() % 100 < age_chance(u->age, WYRMAGE, 1)) {
|
||||
double q = (double)u->hp / (double)(unit_max_hp(u) * u->number);
|
||||
u_setrace(u, get_race(RC_WYRM));
|
||||
u->irace = NULL;
|
||||
u->hp = (int)(unit_max_hp(u) * u->number * q);
|
||||
evolve_dragon(u, get_race(RC_WYRM));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue