Update 1 changes

This commit is contained in:
Mike Rubits
2023-10-03 14:43:06 -04:00
parent 60f29560f3
commit 8dc1fc9794
67 changed files with 1806 additions and 1479 deletions

View File

@@ -22,10 +22,10 @@ constexpr int WIDOW_RAIL_DAMAGE = 50;
bool infront(edict_t *self, edict_t *other);
static int sound_pain1;
static int sound_pain2;
static int sound_pain3;
static int sound_rail;
static cached_soundindex sound_pain1;
static cached_soundindex sound_pain2;
static cached_soundindex sound_pain3;
static cached_soundindex sound_rail;
static uint32_t shotsfired;
@@ -1126,13 +1126,6 @@ void WidowPowerups(edict_t *self)
MONSTERINFO_CHECKATTACK(Widow_CheckAttack) (edict_t *self) -> bool
{
vec3_t spot1, spot2;
vec3_t temp;
float chance;
trace_t tr;
float enemy_yaw;
float real_enemy_range;
if (!self->enemy)
return false;
@@ -1165,85 +1158,7 @@ MONSTERINFO_CHECKATTACK(Widow_CheckAttack) (edict_t *self) -> bool
return true;
}
if (self->enemy->health > 0)
{
// see if any entities are in the way of the shot
spot1 = self->s.origin;
spot1[2] += self->viewheight;
spot2 = self->enemy->s.origin;
spot2[2] += self->enemy->viewheight;
tr = gi.traceline(spot1, spot2, self, CONTENTS_SOLID | CONTENTS_MONSTER | CONTENTS_PLAYER | CONTENTS_SLIME | CONTENTS_LAVA);
// do we have a clear shot?
if (tr.ent != self->enemy && !(tr.ent->svflags & SVF_PLAYER))
{
// go ahead and spawn stuff if we're mad a a client
if (self->enemy->client && M_SlotsLeft(self) >= 2)
{
self->monsterinfo.attack_state = AS_BLIND;
return true;
}
// PGM - we want them to go ahead and shoot at info_notnulls if they can.
if (self->enemy->solid != SOLID_NOT || tr.fraction < 1.0f) // PGM
return false;
}
}
float enemy_range = range_to(self, self->enemy);
temp = self->enemy->s.origin - self->s.origin;
enemy_yaw = vectoyaw(temp);
self->ideal_yaw = enemy_yaw;
real_enemy_range = realrange(self, self->enemy);
// melee attack
if (real_enemy_range <= (MELEE_DISTANCE + 20))
{
// don't always melee in easy mode
if (skill->integer == 0 && irandom(4))
return false;
if (self->monsterinfo.melee)
self->monsterinfo.attack_state = AS_MELEE;
else
self->monsterinfo.attack_state = AS_MISSILE;
return true;
}
if (level.time < self->monsterinfo.attack_finished)
return false;
if (self->monsterinfo.aiflags & AI_STAND_GROUND)
{
chance = 0.4f;
}
else if (enemy_range <= RANGE_MELEE)
{
chance = 0.8f;
}
else if (enemy_range <= RANGE_NEAR)
{
chance = 0.7f;
}
else if (enemy_range <= RANGE_MID)
{
chance = 0.6f;
}
else
{
chance = 0.5f;
}
// PGM - go ahead and shoot every time if it's a info_notnull
if ((frandom() < chance) || (self->enemy->solid == SOLID_NOT))
{
self->monsterinfo.attack_state = AS_MISSILE;
return true;
}
return false;
return M_CheckAttack_Base(self, 0.4f, 0.8f, 0.7f, 0.6f, 0.5f, 0.f);
}
MONSTERINFO_BLOCKED(widow_blocked) (edict_t *self, float dist) -> bool
@@ -1333,10 +1248,10 @@ void SP_monster_widow(edict_t *self)
return;
}
sound_pain1 = gi.soundindex("widow/bw1pain1.wav");
sound_pain2 = gi.soundindex("widow/bw1pain2.wav");
sound_pain3 = gi.soundindex("widow/bw1pain3.wav");
sound_rail = gi.soundindex("gladiator/railgun.wav");
sound_pain1.assign("widow/bw1pain1.wav");
sound_pain2.assign("widow/bw1pain2.wav");
sound_pain3.assign("widow/bw1pain3.wav");
sound_rail.assign("gladiator/railgun.wav");
self->movetype = MOVETYPE_STEP;
self->solid = SOLID_BBOX;