is_monsters() test for skeletons & al

This commit is contained in:
Enno Rehling 2008-05-18 08:21:00 +00:00
parent d442616681
commit 78520fb9bf
3 changed files with 26 additions and 26 deletions

View File

@ -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;
}

View File

@ -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;

View File

@ -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);
}
}