forked from github/server
is_monsters() test for skeletons & al
This commit is contained in:
parent
d442616681
commit
78520fb9bf
3 changed files with 26 additions and 26 deletions
|
@ -1132,7 +1132,7 @@ ally_cmd(unit * u, struct order * ord)
|
|||
skip_token();
|
||||
f = getfaction();
|
||||
|
||||
if (f == 0 || f->no == 0) {
|
||||
if (is_monsters(f)) {
|
||||
cmistake(u, ord, 66, MSG_EVENT);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ write_permissions(const attrib * a, struct storage * store)
|
|||
static int
|
||||
read_permissions(attrib * at, struct storage * store)
|
||||
{
|
||||
attrib * attr;
|
||||
attrib * attr = NULL;
|
||||
a_read(store, &attr);
|
||||
at->data.v = attr;
|
||||
return AT_READ_OK;
|
||||
|
|
|
@ -60,39 +60,39 @@ age_undead(unit *u)
|
|||
void
|
||||
age_skeleton(unit *u)
|
||||
{
|
||||
if (u->faction->no == 0 && rng_int()%100 < age_chance(u->age, 27, 1)) {
|
||||
int n = max(1,u->number/2);
|
||||
double q = (double) u->hp / (double) (unit_max_hp(u) * u->number);
|
||||
u->race = new_race[RC_SKELETON_LORD];
|
||||
u->irace = new_race[RC_SKELETON_LORD];
|
||||
scale_number(u,n);
|
||||
u->hp = (int) (unit_max_hp(u) * u->number * q);
|
||||
}
|
||||
if (is_monsters(u->faction) && rng_int()%100 < age_chance(u->age, 27, 1)) {
|
||||
int n = max(1,u->number/2);
|
||||
double q = (double) u->hp / (double) (unit_max_hp(u) * u->number);
|
||||
u->race = new_race[RC_SKELETON_LORD];
|
||||
u->irace = new_race[RC_SKELETON_LORD];
|
||||
scale_number(u,n);
|
||||
u->hp = (int) (unit_max_hp(u) * u->number * q);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
age_zombie(unit *u)
|
||||
{
|
||||
if (u->faction->no == 0 && rng_int()%100 < age_chance(u->age, 27, 1)) {
|
||||
int n = max(1,u->number/2);
|
||||
double q = (double) u->hp / (double) (unit_max_hp(u) * u->number);
|
||||
u->race = new_race[RC_ZOMBIE_LORD];
|
||||
u->irace = new_race[RC_ZOMBIE_LORD];
|
||||
scale_number(u,n);
|
||||
u->hp = (int) (unit_max_hp(u) * u->number * q);
|
||||
}
|
||||
if (is_monsters(u->faction) && rng_int()%100 < age_chance(u->age, 27, 1)) {
|
||||
int n = max(1,u->number/2);
|
||||
double q = (double) u->hp / (double) (unit_max_hp(u) * u->number);
|
||||
u->race = new_race[RC_ZOMBIE_LORD];
|
||||
u->irace = new_race[RC_ZOMBIE_LORD];
|
||||
scale_number(u,n);
|
||||
u->hp = (int) (unit_max_hp(u) * u->number * q);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
age_ghoul(unit *u)
|
||||
{
|
||||
if (u->faction->no == 0 && rng_int()%100 < age_chance(u->age, 27, 1)) {
|
||||
int n = max(1,u->number/2);
|
||||
double q = (double) u->hp / (double) (unit_max_hp(u) * u->number);
|
||||
u->race = new_race[RC_GHOUL_LORD];
|
||||
u->irace = new_race[RC_GHOUL_LORD];
|
||||
scale_number(u,n);
|
||||
u->hp = (int) (unit_max_hp(u) * u->number * q);
|
||||
}
|
||||
if (is_monsters(u->faction) && rng_int()%100 < age_chance(u->age, 27, 1)) {
|
||||
int n = max(1,u->number/2);
|
||||
double q = (double) u->hp / (double) (unit_max_hp(u) * u->number);
|
||||
u->race = new_race[RC_GHOUL_LORD];
|
||||
u->irace = new_race[RC_GHOUL_LORD];
|
||||
scale_number(u,n);
|
||||
u->hp = (int) (unit_max_hp(u) * u->number * q);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue