From afc3c22b84daa462d9938b9a8ef2947766079a05 Mon Sep 17 00:00:00 2001 From: NeonKnightOA Date: Wed, 22 Jan 2020 13:42:15 -0300 Subject: [PATCH] Easier handling of skill levels by using defines instead of numbers --- src/g_ai.c | 6 +++--- src/g_combat.c | 4 ++-- src/g_items.c | 2 +- src/g_spawn.c | 12 ++++++------ src/g_weapon.c | 4 ++-- src/monster/berserker/berserker.c | 2 +- src/monster/boss/boss.c | 12 ++++++------ src/monster/boss3/boss31.c | 2 +- src/monster/boss3/boss32.c | 2 +- src/monster/brain/brain.c | 4 ++-- src/monster/chick/chick.c | 2 +- src/monster/flipper/flipper.c | 2 +- src/monster/float/float.c | 2 +- src/monster/flyer/flyer.c | 2 +- src/monster/gladiator/gladiator.c | 2 +- src/monster/gunner/gunner.c | 4 ++-- src/monster/hound/hound.c | 2 +- src/monster/hover/hover.c | 2 +- src/monster/infantry/infantry.c | 2 +- src/monster/insane/insane.c | 2 +- src/monster/medic/medic.c | 2 +- src/monster/mutant/mutant.c | 4 ++-- src/monster/parasite/parasite.c | 2 +- src/monster/sentien/sentien.c | 18 +++++++++--------- src/monster/soldier/soldier.c | 20 ++++++++++---------- src/monster/supertank/supertank.c | 4 ++-- src/monster/tank/tank.c | 8 ++++---- src/player/hud.c | 6 +++--- src/zaero/acannon.c | 2 +- 29 files changed, 69 insertions(+), 69 deletions(-) diff --git a/src/g_ai.c b/src/g_ai.c index e141c56..e39bd11 100644 --- a/src/g_ai.c +++ b/src/g_ai.c @@ -653,7 +653,7 @@ qboolean 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) ) return false; if (self->monsterinfo.melee) self->monsterinfo.attack_state = AS_MELEE; @@ -693,9 +693,9 @@ qboolean 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; if (random () < chance) diff --git a/src/g_combat.c b/src/g_combat.c index d725de1..3164abc 100644 --- a/src/g_combat.c +++ b/src/g_combat.c @@ -404,7 +404,7 @@ void T_Damage (edict_t *targ, edict_t *inflictor, edict_t *attacker, vec3_t dir, meansOfDeath = mod; // 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; if (!damage) @@ -541,7 +541,7 @@ void 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; } } diff --git a/src/g_items.c b/src/g_items.c index 71daa54..9f2c0e5 100644 --- a/src/g_items.c +++ b/src/g_items.c @@ -170,7 +170,7 @@ qboolean Pickup_Powerup (edict_t *ent, edict_t *other) int quantity; 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; if ((coop->value) && (ent->item->flags & IT_STAY_COOP) && (quantity > 0)) diff --git a/src/g_spawn.c b/src/g_spawn.c index bc169e5..5234990 100644 --- a/src/g_spawn.c +++ b/src/g_spawn.c @@ -647,9 +647,9 @@ void 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++; @@ -662,9 +662,9 @@ void SpawnEntities (const char *mapname, char *entities, const char *spawnpoint) { if (((!coop->value) && (ent->spawnflags2 & SPAWNFLAG2_NOT_SINGLE)) || ((coop->value) && (ent->spawnflags2 & SPAWNFLAG2_NOT_COOP)) || - ((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)) + ((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); diff --git a/src/g_weapon.c b/src/g_weapon.c index f570519..aab7bcd 100644 --- a/src/g_weapon.c +++ b/src/g_weapon.c @@ -18,7 +18,7 @@ void check_dodge (edict_t *self, vec3_t start, vec3_t dir, int speed) float eta; // easy mode only ducks one quarter the time - if (skill->value == 0) + if (skill->value == SKILL_EASY) { if (random() > 0.25) return; @@ -41,7 +41,7 @@ void check_dodge (edict_t *self, vec3_t start, vec3_t dir, int speed) tr.ent->monsterinfo.dodgetimeout = 0; } - if(skill->value > 3) + if(skill->value > SKILL_HARDPLUS) { skilllevel = 3; } diff --git a/src/monster/berserker/berserker.c b/src/monster/berserker/berserker.c index dc0d8a7..eef887f 100644 --- a/src/monster/berserker/berserker.c +++ b/src/monster/berserker/berserker.c @@ -255,7 +255,7 @@ void berserk_pain (edict_t *self, edict_t *other, 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 if ((damage < 20) || (random() < 0.5)) diff --git a/src/monster/boss/boss.c b/src/monster/boss/boss.c index dd449b5..4f3a4c3 100644 --- a/src/monster/boss/boss.c +++ b/src/monster/boss/boss.c @@ -441,7 +441,7 @@ void zboss_pain (edict_t *self, edict_t *other, float kick, int damage) self->pain_debounce_time = level.time + 5; - if (skill->value == 3) + if (skill->value == SKILL_HARDPLUS) return; // no pain anims in nightmare if(self->laser) @@ -1061,11 +1061,11 @@ void FireCannon(edict_t *self) distance = 700; } - if(skill->value < 2) + if(skill->value < SKILL_HARD) { fire_plasmaCannon (self, start, dir, 90, 700, 2.5, 90+40, distance); } - else if(skill->value < 3) + else if(skill->value < SKILL_HARDPLUS) { fire_plasmaCannon (self, start, dir, 90, (int)(distance * 1.2), 2.5, 90+40, distance); } @@ -1659,15 +1659,15 @@ void SP_monster_zboss (edict_t *self) self->monsterinfo.aiflags = AI_MONREDUCEDDAMAGE; self->monsterinfo.reducedDamageAmount = 0.25; - if(skill->value == 0) + if(skill->value == SKILL_EASY) { self->health = 3000; } - else if(skill->value == 1) + else if(skill->value == SKILL_MEDIUM) { self->health = 4500; } - else if(skill->value == 2) + else if(skill->value == SKILL_HARD) { self->health = 6000; } diff --git a/src/monster/boss3/boss31.c b/src/monster/boss3/boss31.c index 8fb945f..f7ad690 100644 --- a/src/monster/boss3/boss31.c +++ b/src/monster/boss3/boss31.c @@ -430,7 +430,7 @@ void jorg_pain (edict_t *self, edict_t *other, 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 if (damage <= 50) diff --git a/src/monster/boss3/boss32.c b/src/monster/boss3/boss32.c index 9c0155c..d157558 100644 --- a/src/monster/boss3/boss32.c +++ b/src/monster/boss3/boss32.c @@ -554,7 +554,7 @@ void makron_pain (edict_t *self, edict_t *other, float kick, int damage) return; self->pain_debounce_time = level.time + 3; - if (skill->value == 3) + if (skill->value == SKILL_HARDPLUS) return; // no pain anims in nightmare diff --git a/src/monster/brain/brain.c b/src/monster/brain/brain.c index a9835a4..e3a8ff4 100644 --- a/src/monster/brain/brain.c +++ b/src/monster/brain/brain.c @@ -385,7 +385,7 @@ void brain_tentacle_attack (edict_t *self) vec3_t aim; VectorSet (aim, MELEE_DISTANCE, 0, 8); - if (fire_hit (self, aim, (10 + (rand() %5)), -600) && skill->value > 0) + if (fire_hit (self, aim, (10 + (rand() %5)), -600) && skill->value > SKILL_EASY) self->spawnflags |= 65536; gi.sound (self, CHAN_WEAPON, sound_tentacles_retract, 1, ATTN_NORM, 0); } @@ -472,7 +472,7 @@ void brain_pain (edict_t *self, edict_t *other, float kick, int damage) return; self->pain_debounce_time = level.time + 3; - if (skill->value == 3) + if (skill->value == SKILL_HARDPLUS) return; // no pain anims in nightmare r = random(); diff --git a/src/monster/chick/chick.c b/src/monster/chick/chick.c index 8c9ee4d..49d5427 100644 --- a/src/monster/chick/chick.c +++ b/src/monster/chick/chick.c @@ -264,7 +264,7 @@ void chick_pain (edict_t *self, edict_t *other, float kick, int damage) else 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 if (damage <= 10) diff --git a/src/monster/flipper/flipper.c b/src/monster/flipper/flipper.c index 1767586..e54aec4 100644 --- a/src/monster/flipper/flipper.c +++ b/src/monster/flipper/flipper.c @@ -213,7 +213,7 @@ void flipper_pain (edict_t *self, edict_t *other, 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 n = (rand() + 1) % 2; diff --git a/src/monster/float/float.c b/src/monster/float/float.c index a6de674..f9a550a 100644 --- a/src/monster/float/float.c +++ b/src/monster/float/float.c @@ -553,7 +553,7 @@ void floater_pain (edict_t *self, edict_t *other, float kick, int damage) return; self->pain_debounce_time = level.time + 3; - if (skill->value == 3) + if (skill->value == SKILL_HARDPLUS) return; // no pain anims in nightmare n = (rand() + 1) % 3; diff --git a/src/monster/flyer/flyer.c b/src/monster/flyer/flyer.c index 5203dbd..63d1212 100644 --- a/src/monster/flyer/flyer.c +++ b/src/monster/flyer/flyer.c @@ -512,7 +512,7 @@ void flyer_pain (edict_t *self, edict_t *other, float kick, int damage) return; self->pain_debounce_time = level.time + 3; - if (skill->value == 3) + if (skill->value == SKILL_HARDPLUS) return; // no pain anims in nightmare n = rand() % 3; diff --git a/src/monster/gladiator/gladiator.c b/src/monster/gladiator/gladiator.c index d8dcd60..c4713aa 100644 --- a/src/monster/gladiator/gladiator.c +++ b/src/monster/gladiator/gladiator.c @@ -238,7 +238,7 @@ void gladiator_pain (edict_t *self, edict_t *other, float kick, int damage) else 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 if (self->velocity[2] > 100) diff --git a/src/monster/gunner/gunner.c b/src/monster/gunner/gunner.c index 37b22c2..19440fb 100644 --- a/src/monster/gunner/gunner.c +++ b/src/monster/gunner/gunner.c @@ -276,7 +276,7 @@ void gunner_pain (edict_t *self, edict_t *other, float kick, int damage) else 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 if (damage <= 10) @@ -346,7 +346,7 @@ void gunner_duck_down (edict_t *self) if (self->monsterinfo.aiflags & AI_DUCKED) return; self->monsterinfo.aiflags |= AI_DUCKED; - if (skill->value >= 2) + if (skill->value >= SKILL_HARD) { if (random() > 0.5) GunnerGrenade (self); diff --git a/src/monster/hound/hound.c b/src/monster/hound/hound.c index 195f5ee..f3f44ee 100644 --- a/src/monster/hound/hound.c +++ b/src/monster/hound/hound.c @@ -204,7 +204,7 @@ void hound_pain (edict_t *self, edict_t *other, 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 if (random() < 0.5) diff --git a/src/monster/hover/hover.c b/src/monster/hover/hover.c index f4544da..86c3d09 100644 --- a/src/monster/hover/hover.c +++ b/src/monster/hover/hover.c @@ -475,7 +475,7 @@ void hover_pain (edict_t *self, edict_t *other, 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 if (damage <= 25) diff --git a/src/monster/infantry/infantry.c b/src/monster/infantry/infantry.c index e2a016c..ac9885a 100644 --- a/src/monster/infantry/infantry.c +++ b/src/monster/infantry/infantry.c @@ -205,7 +205,7 @@ void infantry_pain (edict_t *self, edict_t *other, 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 n = rand() % 2; diff --git a/src/monster/insane/insane.c b/src/monster/insane/insane.c index c570088..3752299 100644 --- a/src/monster/insane/insane.c +++ b/src/monster/insane/insane.c @@ -475,7 +475,7 @@ void insane_pain (edict_t *self, edict_t *other, float kick, int damage) l = 100; gi.sound (self, CHAN_VOICE, gi.soundindex (va("player/male/pain%i_%i.wav", l, r)), 1, ATTN_IDLE, 0); - if (skill->value == 3) + if (skill->value == SKILL_HARDPLUS) return; // no pain anims in nightmare // Don't go into pain frames if crucified. diff --git a/src/monster/medic/medic.c b/src/monster/medic/medic.c index b1a0c95..bb081ad 100644 --- a/src/monster/medic/medic.c +++ b/src/monster/medic/medic.c @@ -305,7 +305,7 @@ void medic_pain (edict_t *self, edict_t *other, 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 if (random() < 0.5) diff --git a/src/monster/mutant/mutant.c b/src/monster/mutant/mutant.c index 857842d..a6045fa 100644 --- a/src/monster/mutant/mutant.c +++ b/src/monster/mutant/mutant.c @@ -260,7 +260,7 @@ void mutant_check_refire (edict_t *self) if (!self->enemy || !self->enemy->inuse || self->enemy->health <= 0) 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; } @@ -486,7 +486,7 @@ void mutant_pain (edict_t *self, edict_t *other, 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 r = random(); diff --git a/src/monster/parasite/parasite.c b/src/monster/parasite/parasite.c index 96cec2d..0e33866 100644 --- a/src/monster/parasite/parasite.c +++ b/src/monster/parasite/parasite.c @@ -263,7 +263,7 @@ void parasite_pain (edict_t *self, edict_t *other, 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 if (random() < 0.5) diff --git a/src/monster/sentien/sentien.c b/src/monster/sentien/sentien.c index e5bfd35..7d64cea 100644 --- a/src/monster/sentien/sentien.c +++ b/src/monster/sentien/sentien.c @@ -469,11 +469,11 @@ void sentien_post_blast_attack(edict_t *self) if (visible(self, self->enemy) && infront(self, self->enemy)) { - if(skill->value == 1) + if(skill->value == SKILL_MEDIUM) refire = 0.40; - else if(skill->value == 2) + else if(skill->value == SKILL_HARD) refire = 0.60; - else if(skill->value >= 3) + else if(skill->value >= SKILL_HARDPLUS) refire = 0.75; if (random() > refire) @@ -772,12 +772,12 @@ void sentien_fend (edict_t *self, edict_t *attacker, float eta) self->monsterinfo.currentmove == &sentien_move_blast_attack) return; - if (skill->value == 0) + if (skill->value == SKILL_EASY) { if (random() > 0.45) return; } - else if(skill->value == 1) + else if(skill->value == SKILL_MEDIUM) { if (random() > 0.60) return; @@ -881,14 +881,14 @@ void sentien_pain (edict_t *self, edict_t *other, float kick, int damage) return; } - if (skill->value >= 1) + if (skill->value >= SKILL_MEDIUM) { // don't flinch if attacking if(self->monsterinfo.currentmove == &sentien_move_laser_attack || self->monsterinfo.currentmove == &sentien_move_blast_attack) return; } - if (skill->value == 3) + if (skill->value == SKILL_HARDPLUS) return; // no pain anims in nightmare target_laser_off(self->laser); @@ -1132,12 +1132,12 @@ void SP_monster_sentien(edict_t *self) create_sentien_laser(self); - if(skill->value == 2) + if(skill->value == SKILL_HARD) { self->laser->dmg *= 1.5; self->yaw_speed *= 1.5; } - else if(skill->value >= 3) + else if(skill->value >= SKILL_HARDPLUS) { self->laser->dmg *= 2.5; self->yaw_speed *= 2; diff --git a/src/monster/soldier/soldier.c b/src/monster/soldier/soldier.c index 35dbc4b..fd14a3d 100644 --- a/src/monster/soldier/soldier.c +++ b/src/monster/soldier/soldier.c @@ -355,7 +355,7 @@ void soldier_pain (edict_t *self, edict_t *other, float kick, int damage) return; } - if (skill->value == 3) + if (skill->value == SKILL_HARDPLUS) return; // no pain anims in nightmare r = random(); @@ -456,7 +456,7 @@ void soldier_attack1_refire1 (edict_t *self) if (self->enemy->health <= 0) 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; else self->monsterinfo.nextframe = FRAME_attak110; @@ -470,7 +470,7 @@ void soldier_attack1_refire2 (edict_t *self) if (self->enemy->health <= 0) 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; } @@ -506,7 +506,7 @@ void soldier_attack2_refire1 (edict_t *self) if (self->enemy->health <= 0) 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; else self->monsterinfo.nextframe = FRAME_attak216; @@ -520,7 +520,7 @@ void soldier_attack2_refire2 (edict_t *self) if (self->enemy->health <= 0) 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; } @@ -627,7 +627,7 @@ void soldier_attack6_refire (edict_t *self) if (range(self, self->enemy) < RANGE_MID) return; - if (skill->value == 3) + if (skill->value == SKILL_HARDPLUS) self->monsterinfo.nextframe = FRAME_runs03; } @@ -677,7 +677,7 @@ void soldier_sight(edict_t *self, edict_t *other) else gi.sound (self, CHAN_VOICE, sound_sight2, 1, ATTN_NORM, 0); - if ((skill->value > 0) && (range(self, self->enemy) >= RANGE_MID)) + if ((skill->value > SKILL_EASY) && (range(self, self->enemy) >= RANGE_MID)) { if (random() > 0.5) self->monsterinfo.currentmove = &soldier_move_attack6; @@ -717,7 +717,7 @@ void soldier_dodge (edict_t *self, edict_t *attacker, float eta) if (!self->enemy) self->enemy = attacker; - if (skill->value == 0) + if (skill->value == SKILL_EASY) { self->monsterinfo.currentmove = &soldier_move_duck; return; @@ -726,7 +726,7 @@ void soldier_dodge (edict_t *self, edict_t *attacker, float eta) self->monsterinfo.pausetime = level.time + eta + 0.3; r = random(); - if (skill->value == 1) + if (skill->value == SKILL_MEDIUM) { if (r > 0.33) self->monsterinfo.currentmove = &soldier_move_duck; @@ -735,7 +735,7 @@ void soldier_dodge (edict_t *self, edict_t *attacker, float eta) return; } - if (skill->value >= 2) + if (skill->value >= SKILL_HARD) { if (r > 0.66) self->monsterinfo.currentmove = &soldier_move_duck; diff --git a/src/monster/supertank/supertank.c b/src/monster/supertank/supertank.c index 122c6a9..bf5285e 100644 --- a/src/monster/supertank/supertank.c +++ b/src/monster/supertank/supertank.c @@ -445,13 +445,13 @@ void supertank_pain (edict_t *self, edict_t *other, float kick, int damage) return; // 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) ) return; self->pain_debounce_time = level.time + 3; - if (skill->value == 3) + if (skill->value == SKILL_HARDPLUS) return; // no pain anims in nightmare if (damage <= 10) diff --git a/src/monster/tank/tank.c b/src/monster/tank/tank.c index 01e71eb..6e5a75a 100644 --- a/src/monster/tank/tank.c +++ b/src/monster/tank/tank.c @@ -282,7 +282,7 @@ void tank_pain (edict_t *self, edict_t *other, float kick, int damage) return; // 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) ) return; @@ -293,7 +293,7 @@ void tank_pain (edict_t *self, edict_t *other, 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 if (damage <= 30) @@ -453,7 +453,7 @@ mmove_t tank_move_attack_post_blast = {FRAME_attak117, FRAME_attak122, tank_fram void tank_reattack_blaster (edict_t *self) { - if (skill->value >= 2) + if (skill->value >= SKILL_HARD) if (visible (self, self->enemy)) if (self->enemy->health > 0) if (random() <= 0.6) @@ -623,7 +623,7 @@ mmove_t tank_move_attack_chain = {FRAME_attak401, FRAME_attak429, tank_frames_at void 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) if (visible(self, self->enemy) ) if (random() <= 0.4) diff --git a/src/player/hud.c b/src/player/hud.c index cf18922..05cf9b4 100644 --- a/src/player/hud.c +++ b/src/player/hud.c @@ -288,11 +288,11 @@ void HelpComputer (edict_t *ent) char string[1024]; char *sk; - 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"; else sk = "hard+"; diff --git a/src/zaero/acannon.c b/src/zaero/acannon.c index 9c7c526..7565ad0 100644 --- a/src/zaero/acannon.c +++ b/src/zaero/acannon.c @@ -792,7 +792,7 @@ void SP_monster_autocannon(edict_t *self) self->style = 1; // if we're on hard or nightmare, use fast lasers - if (skill->value >= 2 && self->style == 4) + if (skill->value >= SKILL_HARD && self->style == 4) self->style = 3; // precache some sounds and models