Easier handling of skill levels by using defines instead of numbers

This commit is contained in:
NeonKnightOA 2020-01-22 12:37:33 -03:00
parent 6c833aae3e
commit 83fe44691d
31 changed files with 112 additions and 106 deletions

View file

@ -896,7 +896,7 @@ M_CheckAttack(edict_t *self)
if (enemy_range == RANGE_MELEE)
{
/* don't always melee in easy mode */
if ((skill->value == 0) && (rand() & 3))
if ((skill->value == SKILL_EASY) && (rand() & 3))
{
/* fix for melee only monsters & strafing */
self->monsterinfo.attack_state = AS_STRAIGHT;
@ -950,11 +950,11 @@ M_CheckAttack(edict_t *self)
return false;
}
if (skill->value == 0)
if (skill->value == SKILL_EASY)
{
chance *= 0.5;
}
else if (skill->value >= 2)
else if (skill->value >= SKILL_HARD)
{
chance *= 2;
}

View file

@ -698,7 +698,7 @@ T_Damage(edict_t *targ, edict_t *inflictor, edict_t *attacker, vec3_t dir,
}
/* easy mode takes half damage */
if ((skill->value == 0) && (deathmatch->value == 0) && targ->client)
if ((skill->value == SKILL_EASY) && (deathmatch->value == 0) && targ->client)
{
damage *= 0.5;
@ -917,7 +917,7 @@ T_Damage(edict_t *targ, edict_t *inflictor, edict_t *attacker, vec3_t dir,
targ->pain(targ, attacker, knockback, take);
/* nightmare mode monsters don't go into pain frames often */
if (skill->value == 3)
if (skill->value == SKILL_HARDPLUS)
{
targ->pain_debounce_time = level.time + 5;
}

View file

@ -200,8 +200,8 @@ Pickup_Powerup(edict_t *ent, edict_t *other)
quantity = other->client->pers.inventory[ITEM_INDEX(ent->item)];
if (((skill->value == 1) &&
(quantity >= 2)) || ((skill->value >= 2) && (quantity >= 1)))
if (((skill->value == SKILL_MEDIUM) &&
(quantity >= 2)) || ((skill->value >= SKILL_HARD) && (quantity >= 1)))
{
return false;
}
@ -769,8 +769,8 @@ Pickup_Sphere(edict_t *ent, edict_t *other)
quantity = other->client->pers.inventory[ITEM_INDEX(ent->item)];
if (((skill->value == 1) &&
(quantity >= 2)) || ((skill->value >= 2) && (quantity >= 1)))
if (((skill->value == SKILL_MEDIUM) &&
(quantity >= 2)) || ((skill->value >= SKILL_HARD) && (quantity >= 1)))
{
return false;
}

View file

@ -862,9 +862,9 @@ SpawnEntities(const char *mapname, char *entities, const char *spawnpoint)
(ent->spawnflags & SPAWNFLAG_NOT_MEDIUM) &&
(ent->spawnflags & SPAWNFLAG_NOT_HARD)))
{
if (((skill->value == 0) && (ent->spawnflags & SPAWNFLAG_NOT_EASY)) ||
((skill->value == 1) && (ent->spawnflags & SPAWNFLAG_NOT_MEDIUM)) ||
(((skill->value == 2) || (skill->value == 3)) && (ent->spawnflags & SPAWNFLAG_NOT_HARD)))
if (((skill->value == SKILL_EASY) && (ent->spawnflags & SPAWNFLAG_NOT_EASY)) ||
((skill->value == SKILL_MEDIUM) && (ent->spawnflags & SPAWNFLAG_NOT_MEDIUM)) ||
(((skill->value == SKILL_HARD) || (skill->value == SKILL_HARDPLUS)) && (ent->spawnflags & SPAWNFLAG_NOT_HARD)))
{
G_FreeEdict(ent);
inhibit++;
@ -874,9 +874,9 @@ SpawnEntities(const char *mapname, char *entities, const char *spawnpoint)
}
else
{
if (((skill->value == 0) && (ent->spawnflags & SPAWNFLAG_NOT_EASY)) ||
((skill->value == 1) && (ent->spawnflags & SPAWNFLAG_NOT_MEDIUM)) ||
(((skill->value == 2) || (skill->value == 3)) && (ent->spawnflags & SPAWNFLAG_NOT_HARD)))
if (((skill->value == SKILL_EASY) && (ent->spawnflags & SPAWNFLAG_NOT_EASY)) ||
((skill->value == SKILL_MEDIUM) && (ent->spawnflags & SPAWNFLAG_NOT_MEDIUM)) ||
(((skill->value == SKILL_HARD) || (skill->value == SKILL_HARDPLUS)) && (ent->spawnflags & SPAWNFLAG_NOT_HARD)))
{
G_FreeEdict(ent);
inhibit++;

View file

@ -26,7 +26,7 @@ check_dodge(edict_t *self, vec3_t start, vec3_t dir, int speed)
}
/* easy mode only ducks one quarter the time */
if (skill->value == 0)
if (skill->value == SKILL_EASY)
{
if (random() > 0.25)
{

View file

@ -562,6 +562,12 @@ extern int gibsthisframe;
#define MOD_DOPPLE_VENGEANCE 54
#define MOD_DOPPLE_HUNTER 55
/* Easier handling of AI skill levels */
#define SKILL_EASY 0
#define SKILL_MEDIUM 1
#define SKILL_HARD 2
#define SKILL_HARDPLUS 3
extern int meansOfDeath;
extern edict_t *g_edicts;

View file

@ -382,7 +382,7 @@ berserk_pain(edict_t *self, edict_t *other /* unused */, float kick, int damage)
self->pain_debounce_time = level.time + 3;
gi.sound(self, CHAN_VOICE, sound_pain, 1, ATTN_NORM, 0);
if (skill->value == 3)
if (skill->value == SKILL_HARDPLUS)
{
return; /* no pain anims in nightmare */
}

View file

@ -579,7 +579,7 @@ jorg_pain(edict_t *self, edict_t *other /* unused */, float kick, int damage)
self->pain_debounce_time = level.time + 3;
if (skill->value == 3)
if (skill->value == SKILL_HARDPLUS)
{
return; /* no pain anims in nightmare */
}

View file

@ -718,7 +718,7 @@ makron_pain(edict_t *self, edict_t *other /* unused */, float kick, int damage)
self->pain_debounce_time = level.time + 3;
if (skill->value == 3)
if (skill->value == SKILL_HARDPLUS)
{
return; /* no pain anims in nightmare */
}

View file

@ -582,7 +582,7 @@ brain_pain(edict_t *self, edict_t *other /* unused */, float kick /* unused */,
self->pain_debounce_time = level.time + 3;
if (skill->value == 3)
if (skill->value == SKILL_HARDPLUS)
{
return; /* no pain anims in nightmare */
}
@ -693,7 +693,7 @@ brain_duck(edict_t *self, float eta)
/* has to be done immediately otherwise he can get stuck */
monster_duck_down(self);
if (skill->value == 0)
if (skill->value == SKILL_EASY)
{
/* PMM - stupid dodge */
self->monsterinfo.duck_wait_time = level.time + eta + 1;

View file

@ -1274,7 +1274,7 @@ carrier_pain(edict_t *self, edict_t *other /* unused */, float kick /* unused */
self->s.skinnum = 1;
}
if (skill->value == 3)
if (skill->value == SKILL_HARDPLUS)
{
return; /* no pain anims in nightmare */
}

View file

@ -359,7 +359,7 @@ chick_pain(edict_t *self, edict_t *other /* other */, float kick /* other */, in
gi.sound(self, CHAN_VOICE, sound_pain3, 1, ATTN_NORM, 0);
}
if (skill->value == 3)
if (skill->value == SKILL_HARDPLUS)
{
return; /* no pain anims in nightmare */
}
@ -1004,7 +1004,7 @@ chick_duck(edict_t *self, float eta)
}
}
if (skill->value == 0)
if (skill->value == SKILL_EASY)
{
/* stupid dodge */
self->monsterinfo.duck_wait_time = level.time + eta + 1;
@ -1034,7 +1034,7 @@ chick_sidestep(edict_t *self)
(self->monsterinfo.currentmove == &chick_move_attack1))
{
/* if we're shooting, and not on easy, don't dodge */
if (skill->value)
if (skill->value > SKILL_EASY)
{
self->monsterinfo.aiflags &= ~AI_DODGING;
return;

View file

@ -307,7 +307,7 @@ flipper_pain(edict_t *self, edict_t *other /* unused */, float kick, int damage)
self->pain_debounce_time = level.time + 3;
if (skill->value == 3)
if (skill->value == SKILL_HARDPLUS)
{
return; /* no pain anims in nightmare */
}

View file

@ -687,7 +687,7 @@ floater_attack(edict_t *self)
// 50% chance in normal
// 75% chance in hard
// 86.67% chance in nightmare
if (!skill->value)
if (skill->value == SKILL_EASY)
{
chance = 0;
}
@ -753,7 +753,7 @@ floater_pain(edict_t *self, edict_t *other /* unused */, float kick, int damage)
self->pain_debounce_time = level.time + 3;
if (skill->value == 3)
if (skill->value == SKILL_HARDPLUS)
{
return; /* no pain anims in nightmare */
}

View file

@ -789,7 +789,7 @@ flyer_attack(edict_t *self)
return;
}
if (!skill->value)
if (skill->value == SKILL_EASY)
{
chance = 0;
}
@ -915,7 +915,7 @@ flyer_pain(edict_t *self, edict_t *other /* unused */, float kick, int damage)
self->pain_debounce_time = level.time + 3;
if (skill->value == 3)
if (skill->value == SKILL_HARDPLUS)
{
return; /* no pain anims in nightmare */
}

View file

@ -359,7 +359,7 @@ gladiator_pain(edict_t *self, edict_t *other /* unused */, float kick, int damag
gi.sound(self, CHAN_VOICE, sound_pain2, 1, ATTN_NORM, 0);
}
if (skill->value == 3)
if (skill->value == SKILL_HARDPLUS)
{
return; /* no pain anims in nightmare */
}

View file

@ -388,7 +388,7 @@ gunner_pain(edict_t *self, edict_t *other /* unused */, float kick, int damage)
gi.sound(self, CHAN_VOICE, sound_pain2, 1, ATTN_NORM, 0);
}
if (skill->value == 3)
if (skill->value == SKILL_HARDPLUS)
{
return; /* no pain anims in nightmare */
}
@ -504,7 +504,7 @@ gunner_duck_down(edict_t *self)
self->monsterinfo.aiflags |= AI_DUCKED;
if (skill->value >= 2)
if (skill->value >= SKILL_HARD)
{
if (random() > 0.5)
{
@ -1136,14 +1136,14 @@ gunner_duck(edict_t *self, float eta)
)
{
/* if we're shooting, and not on easy, don't dodge */
if (skill->value)
if (skill->value > SKILL_EASY)
{
self->monsterinfo.aiflags &= ~AI_DUCKED;
return;
}
}
if (skill->value == 0)
if (skill->value == SKILL_EASY)
{
/* stupid dodge */
self->monsterinfo.duck_wait_time = level.time + eta + 1;
@ -1181,7 +1181,7 @@ gunner_sidestep(edict_t *self)
)
{
/* if we're shooting, and not on easy, don't dodge */
if (skill->value)
if (skill->value > SKILL_EASY)
{
self->monsterinfo.aiflags &= ~AI_DODGING;
return;

View file

@ -535,7 +535,7 @@ hover_attack(edict_t *self)
return;
}
if (!skill->value)
if (skill->value == SKILL_EASY)
{
chance = 0;
}
@ -586,7 +586,7 @@ hover_pain(edict_t *self, edict_t *other /* unused */, float kick, int damage)
self->pain_debounce_time = level.time + 3;
if (skill->value == 3)
if (skill->value == SKILL_HARDPLUS)
{
return; /* no pain anims in nightmare */
}

View file

@ -277,7 +277,7 @@ infantry_pain(edict_t *self, edict_t *other /* unused */, float kick, int damage
self->pain_debounce_time = level.time + 3;
if (skill->value == 3)
if (skill->value == SKILL_HARDPLUS)
{
return; /* no pain anims in nightmare */
}
@ -854,14 +854,14 @@ infantry_duck(edict_t *self, float eta)
(self->monsterinfo.currentmove == &infantry_move_attack2))
{
/* if we're shooting, and not on easy, don't dodge */
if (skill->value)
if (skill->value > SKILL_EASY)
{
self->monsterinfo.aiflags &= ~AI_DUCKED;
return;
}
}
if (skill->value == 0)
if (skill->value == SKILL_EASY)
{
/* stupid dodge */
self->monsterinfo.duck_wait_time = level.time + eta + 1;
@ -898,7 +898,7 @@ infantry_sidestep(edict_t *self)
(self->monsterinfo.currentmove == &infantry_move_attack2))
{
/* if we're shooting, and not on easy, don't dodge */
if (skill->value)
if (skill->value > SKILL_EASY)
{
self->monsterinfo.aiflags &= ~AI_DODGING;
return;

View file

@ -660,7 +660,7 @@ insane_pain(edict_t *self, edict_t *other /* unused */, float kick, int damage)
/* suppress screaming and moaning for 1 second so pain sound plays */
self->fly_sound_debounce_time = level.time + 1;
if (skill->value == 3)
if (skill->value == SKILL_HARDPLUS)
{
return; /* no pain anims in nightmare */
}

View file

@ -653,7 +653,7 @@ medic_pain(edict_t *self, edict_t *other /* unused */, float kick, int damage)
self->pain_debounce_time = level.time + 3;
if (skill->value == 3)
if (skill->value == SKILL_HARDPLUS)
{
return; /* no pain anims in nightmare */
}
@ -1752,7 +1752,7 @@ medic_checkattack(edict_t *self)
return true;
}
if (skill->value > 0)
if (skill->value > SKILL_EASY)
{
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
{
@ -1813,7 +1813,7 @@ medic_duck(edict_t *self, float eta)
return;
}
if (skill->value == 0)
if (skill->value == SKILL_EASY)
{
/* stupid dodge */
self->monsterinfo.duck_wait_time = level.time + eta + 1;
@ -1845,7 +1845,7 @@ medic_sidestep(edict_t *self)
(self->monsterinfo.currentmove == &medic_move_callReinforcements))
{
/* if we're shooting, and not on easy, don't dodge */
if (skill->value)
if (skill->value > SKILL_EASY)
{
self->monsterinfo.aiflags &= ~AI_DODGING;
return;
@ -1945,19 +1945,19 @@ SP_monster_medic(edict_t *self)
{
self->s.skinnum = 2;
if (skill->value == 0)
if (skill->value == SKILL_EASY)
{
self->monsterinfo.monster_slots = 3;
}
else if (skill->value == 1)
else if (skill->value == SKILL_MEDIUM)
{
self->monsterinfo.monster_slots = 4;
}
else if (skill->value == 2)
else if (skill->value == SKILL_HARD)
{
self->monsterinfo.monster_slots = 6;
}
else if (skill->value == 3)
else if (skill->value == SKILL_HARDPLUS)
{
self->monsterinfo.monster_slots = 6;
}

View file

@ -358,7 +358,7 @@ mutant_check_refire(edict_t *self)
return;
}
if (((skill->value == 3) && (random() < 0.5)) || (range(self, self->enemy) == RANGE_MELEE))
if (((skill->value == SKILL_HARDPLUS) && (random() < 0.5)) || (range(self, self->enemy) == RANGE_MELEE))
{
self->monsterinfo.nextframe = FRAME_attack09;
}
@ -674,7 +674,7 @@ mutant_pain(edict_t *self, edict_t *other /* unused */, float kick, int damage)
self->pain_debounce_time = level.time + 3;
if (skill->value == 3)
if (skill->value == SKILL_HARDPLUS)
{
return; /* no pain anims in nightmare */
}

View file

@ -421,7 +421,7 @@ parasite_pain(edict_t *self, edict_t *other /* unused */, float kick, int damage
self->pain_debounce_time = level.time + 3;
if (skill->value == 3)
if (skill->value == SKILL_HARDPLUS)
{
return; /* no pain anims in nightmare */
}

View file

@ -517,7 +517,7 @@ soldier_pain(edict_t *self, edict_t *other /* unused */, float kick, int damage)
return;
}
if (skill->value == 3)
if (skill->value == SKILL_HARDPLUS)
{
return; /* no pain anims in nightmare */
}
@ -640,7 +640,7 @@ soldier_fire(edict_t *self, int in_flash_number)
vectoangles(aim, dir);
AngleVectors(dir, forward, right, up);
if (skill->value < 2)
if (skill->value < SKILL_HARD)
{
r = crandom() * 1000;
u = crandom() * 500;
@ -740,7 +740,7 @@ soldier_attack1_refire1(edict_t *self)
return;
}
if (((skill->value == 3) && (random() < 0.5)) || (range(self, self->enemy) == RANGE_MELEE))
if (((skill->value == SKILL_HARDPLUS) && (random() < 0.5)) || (range(self, self->enemy) == RANGE_MELEE))
{
self->monsterinfo.nextframe = FRAME_attak102;
}
@ -773,7 +773,7 @@ soldier_attack1_refire2(edict_t *self)
return;
}
if (((skill->value == 3) && (random() < 0.5)) || (range(self, self->enemy) == RANGE_MELEE))
if (((skill->value == SKILL_HARDPLUS) && (random() < 0.5)) || (range(self, self->enemy) == RANGE_MELEE))
{
self->monsterinfo.nextframe = FRAME_attak102;
}
@ -835,7 +835,7 @@ soldier_attack2_refire1(edict_t *self)
return;
}
if (((skill->value == 3) && (random() < 0.5)) || (range(self, self->enemy) == RANGE_MELEE))
if (((skill->value == SKILL_HARDPLUS) && (random() < 0.5)) || (range(self, self->enemy) == RANGE_MELEE))
{
self->monsterinfo.nextframe = FRAME_attak204;
}
@ -868,7 +868,7 @@ soldier_attack2_refire2(edict_t *self)
return;
}
if (((skill->value == 3) && (random() < 0.5)) || (range(self, self->enemy) == RANGE_MELEE))
if (((skill->value == SKILL_HARDPLUS) && (random() < 0.5)) || (range(self, self->enemy) == RANGE_MELEE))
{
self->monsterinfo.nextframe = FRAME_attak204;
}
@ -1012,7 +1012,7 @@ soldier_attack6_refire(edict_t *self)
return;
}
if ((skill->value == 3) || ((random() < (0.25 * ((float)skill->value)))))
if ((skill->value == SKILL_HARDPLUS) || ((random() < (0.25 * ((float)skill->value)))))
{
self->monsterinfo.nextframe = FRAME_runs03;
}
@ -1141,7 +1141,7 @@ soldier_sight(edict_t *self, edict_t *other /* unused */)
gi.sound(self, CHAN_VOICE, sound_sight2, 1, ATTN_NORM, 0);
}
if ((skill->value > 0) && (self->enemy) &&
if ((skill->value > SKILL_EASY) && (self->enemy) &&
(range(self, self->enemy) >= RANGE_NEAR))
{
/* don't let machinegunners run & shoot */
@ -1666,7 +1666,7 @@ soldier_duck(edict_t *self, float eta)
/* has to be done immediately otherwise he can get stuck */
monster_duck_down(self);
if (skill->value == 0)
if (skill->value == SKILL_EASY)
{
self->monsterinfo.currentmove = &soldier_move_duck;
self->monsterinfo.duck_wait_time = level.time + eta + 1;

View file

@ -423,11 +423,11 @@ stalker_heal(edict_t *self)
return;
}
if (skill->value == 2)
if (skill->value == SKILL_HARD)
{
self->health += 2;
}
else if (skill->value == 3)
else if (skill->value == SKILL_HARDPLUS)
{
self->health += 3;
}
@ -547,7 +547,7 @@ stalker_pain(edict_t *self, edict_t *other /* unused */, float kick, int damage)
self->s.skinnum = 1;
}
if (skill->value == 3)
if (skill->value == SKILL_HARDPLUS)
{
return; /* no pain anims in nightmare */
}

View file

@ -574,7 +574,7 @@ supertank_pain(edict_t *self, edict_t *other /* unused */, float kick, int damag
}
/* Don't go into pain if he's firing his rockets */
if (skill->value >= 2)
if (skill->value >= SKILL_HARD)
{
if ((self->s.frame >= FRAME_attak2_1) &&
(self->s.frame <= FRAME_attak2_14))
@ -585,7 +585,7 @@ supertank_pain(edict_t *self, edict_t *other /* unused */, float kick, int damag
self->pain_debounce_time = level.time + 3;
if (skill->value == 3)
if (skill->value == SKILL_HARDPLUS)
{
return; /* no pain anims in nightmare */
}

View file

@ -371,7 +371,7 @@ tank_pain(edict_t *self, edict_t *other /* unused */, float kick, int damage)
}
/* If hard or nightmare, don't go into pain while attacking */
if (skill->value >= 2)
if (skill->value >= SKILL_HARD)
{
if ((self->s.frame >= FRAME_attak301) &&
(self->s.frame <= FRAME_attak330))
@ -389,7 +389,7 @@ tank_pain(edict_t *self, edict_t *other /* unused */, float kick, int damage)
self->pain_debounce_time = level.time + 3;
gi.sound(self, CHAN_VOICE, sound_pain, 1, ATTN_NORM, 0);
if (skill->value == 3)
if (skill->value == SKILL_HARDPLUS)
{
return; /* no pain anims in nightmare */
}
@ -722,7 +722,7 @@ tank_reattack_blaster(edict_t *self)
return;
}
if (skill->value >= 2)
if (skill->value >= SKILL_HARD)
{
if (visible(self, self->enemy))
{
@ -942,7 +942,7 @@ tank_refire_rocket(edict_t *self)
}
/* Only on hard or nightmare */
if (skill->value >= 2)
if (skill->value >= SKILL_HARD)
{
if (self->enemy->health > 0)
{

View file

@ -495,22 +495,22 @@ TurretFire(edict_t *self)
{
rocketSpeed = 550;
if (skill->value == 2)
if (skill->value == SKILL_HARD)
{
rocketSpeed += 200 * random();
}
else if (skill->value == 3)
else if (skill->value == SKILL_HARDPLUS)
{
rocketSpeed += 100 + (200 * random());
}
}
else if (self->spawnflags & SPAWN_BLASTER)
{
if (skill->value == 0)
if (skill->value == SKILL_EASY)
{
rocketSpeed = 600;
}
else if (skill->value == 1)
else if (skill->value == SKILL_MEDIUM)
{
rocketSpeed = 800;
}
@ -616,11 +616,11 @@ TurretFireBlind(edict_t *self)
{
rocketSpeed = 550;
if (skill->value == 2)
if (skill->value == SKILL_HARD)
{
rocketSpeed += 200 * random();
}
else if (skill->value == 3)
else if (skill->value == SKILL_HARDPLUS)
{
rocketSpeed += 100 + (200 * random());
}
@ -1053,7 +1053,7 @@ turret_checkattack(edict_t *self)
if (enemy_range == RANGE_MELEE)
{
/* don't always melee in easy mode */
if ((skill->value == 0) && (rand() & 3))
if ((skill->value == SKILL_EASY) && (rand() & 3))
{
return false;
}
@ -1078,11 +1078,11 @@ turret_checkattack(edict_t *self)
nexttime = (0.8 - (0.1 * skill->value));
}
if (skill->value == 0)
if (skill->value == SKILL_EASY)
{
chance *= 0.5;
}
else if (skill->value > 1)
else if (skill->value > SKILL_MEDIUM)
{
chance *= 2;
}

View file

@ -1313,7 +1313,7 @@ widow_pain(edict_t *self, edict_t *other /* unused */, float kick, int damage)
self->s.skinnum = 1;
}
if (skill->value == 3)
if (skill->value == SKILL_HARDPLUS)
{
return; /* no pain anims in nightmare */
}
@ -1336,7 +1336,7 @@ widow_pain(edict_t *self, edict_t *other /* unused */, float kick, int damage)
}
else if (damage < 75)
{
if ((skill->value < 3) && (random() < (0.6 - (0.2 * ((float)skill->value)))))
if ((skill->value < SKILL_HARDPLUS) && (random() < (0.6 - (0.2 * ((float)skill->value)))))
{
self->monsterinfo.currentmove = &widow_move_pain_light;
self->monsterinfo.aiflags &= ~AI_MANUAL_STEERING;
@ -1346,7 +1346,7 @@ widow_pain(edict_t *self, edict_t *other /* unused */, float kick, int damage)
}
else
{
if ((skill->value < 3) && (random() < (0.75 - (0.1 * ((float)skill->value)))))
if ((skill->value < SKILL_HARDPLUS) && (random() < (0.75 - (0.1 * ((float)skill->value)))))
{
self->monsterinfo.currentmove = &widow_move_pain_heavy;
self->monsterinfo.aiflags &= ~AI_MANUAL_STEERING;
@ -1463,15 +1463,15 @@ WidowRespondPowerup(edict_t *self, edict_t *other)
if (other->s.effects & EF_QUAD)
{
if (skill->value == 1)
if (skill->value == SKILL_MEDIUM)
{
WidowDouble(self, other->client->quad_framenum);
}
else if (skill->value == 2)
else if (skill->value == SKILL_HARD)
{
WidowGoinQuad(self, other->client->quad_framenum);
}
else if (skill->value == 3)
else if (skill->value == SKILL_HARDPLUS)
{
WidowGoinQuad(self, other->client->quad_framenum);
WidowPowerArmor(self);
@ -1479,11 +1479,11 @@ WidowRespondPowerup(edict_t *self, edict_t *other)
}
else if (other->s.effects & EF_DOUBLE)
{
if (skill->value == 2)
if (skill->value == SKILL_HARD)
{
WidowDouble(self, other->client->double_framenum);
}
else if (skill->value == 3)
else if (skill->value == SKILL_HARDPLUS)
{
WidowDouble(self, other->client->double_framenum);
WidowPowerArmor(self);
@ -1496,15 +1496,15 @@ WidowRespondPowerup(edict_t *self, edict_t *other)
if (other->s.effects & EF_PENT)
{
if (skill->value == 1)
if (skill->value == SKILL_MEDIUM)
{
WidowPowerArmor(self);
}
else if (skill->value == 2)
else if (skill->value == SKILL_HARD)
{
WidowPent(self, other->client->invincible_framenum);
}
else if (skill->value == 3)
else if (skill->value == SKILL_HARDPLUS)
{
WidowPent(self, other->client->invincible_framenum);
WidowPowerArmor(self);
@ -1688,7 +1688,7 @@ Widow_CheckAttack(edict_t *self)
if (real_enemy_range <= (MELEE_DISTANCE + 20))
{
/* don't always melee in easy mode */
if ((skill->value == 0) && (rand() & 3))
if ((skill->value == SKILL_EASY) && (rand() & 3))
{
return false;
}
@ -1778,14 +1778,14 @@ WidowCalcSlots(edict_t *self)
switch ((int)skill->value)
{
case 0:
case 1:
case SKILL_EASY:
case SKILL_MEDIUM:
self->monsterinfo.monster_slots = 3;
break;
case 2:
case SKILL_HARD:
self->monsterinfo.monster_slots = 4;
break;
case 3:
case SKILL_HARDPLUS:
self->monsterinfo.monster_slots = 6;
break;
default:
@ -1872,7 +1872,7 @@ SP_monster_widow(edict_t *self)
self->gib_health = -5000;
self->mass = 1500;
if (skill->value == 3)
if (skill->value == SKILL_HARDPLUS)
{
self->monsterinfo.power_armor_type = POWER_ARMOR_SHIELD;
self->monsterinfo.power_armor_power = 500;

View file

@ -1140,7 +1140,7 @@ widow2_pain(edict_t *self, edict_t *other /* unused */, float kick, int damage)
self->s.skinnum = 1;
}
if (skill->value == 3)
if (skill->value == SKILL_HARDPLUS)
{
return; /* no pain anims in nightmare */
}
@ -1160,7 +1160,7 @@ widow2_pain(edict_t *self, edict_t *other /* unused */, float kick, int damage)
{
gi.sound(self, CHAN_VOICE, sound_pain2, 1, ATTN_NONE, 0);
if ((skill->value < 3) &&
if ((skill->value < SKILL_HARDPLUS) &&
(random() < (0.6 - (0.2 * ((float)skill->value)))))
{
self->monsterinfo.aiflags &= ~AI_MANUAL_STEERING;
@ -1171,7 +1171,7 @@ widow2_pain(edict_t *self, edict_t *other /* unused */, float kick, int damage)
{
gi.sound(self, CHAN_VOICE, sound_pain3, 1, ATTN_NONE, 0);
if ((skill->value < 3) &&
if ((skill->value < SKILL_HARDPLUS) &&
(random() < (0.75 - (0.1 * ((float)skill->value)))))
{
self->monsterinfo.aiflags &= ~AI_MANUAL_STEERING;
@ -1366,7 +1366,7 @@ Widow2_CheckAttack(edict_t *self)
if (widow2_tongue_attack_ok(spot1, spot2, 256))
{
/* be nice in easy mode */
if ((skill->value == 0) && (rand() & 3))
if ((skill->value == SKILL_EASY) && (rand() & 3))
{
return false;
}
@ -1488,7 +1488,7 @@ SP_monster_widow2(edict_t *self)
self->gib_health = -900;
self->mass = 2500;
if (skill->value == 3)
if (skill->value == SKILL_HARDPLUS)
{
self->monsterinfo.power_armor_type = POWER_ARMOR_SHIELD;
self->monsterinfo.power_armor_power = 750;

View file

@ -322,15 +322,15 @@ HelpComputerMessage(edict_t *ent)
return;
}
if (skill->value == 0)
if (skill->value == SKILL_EASY)
{
sk = "easy";
}
else if (skill->value == 1)
else if (skill->value == SKILL_MEDIUM)
{
sk = "medium";
}
else if (skill->value == 2)
else if (skill->value == SKILL_HARD)
{
sk = "hard";
}