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

@@ -29,29 +29,29 @@ bool FindTarget(edict_t *self);
void FoundTarget(edict_t *self);
void ED_CallSpawn(edict_t *ent);
static int sound_idle1;
static int sound_pain1;
static int sound_pain2;
static int sound_die;
static int sound_sight;
static int sound_search;
static int sound_hook_launch;
static int sound_hook_hit;
static int sound_hook_heal;
static int sound_hook_retract;
static cached_soundindex sound_idle1;
static cached_soundindex sound_pain1;
static cached_soundindex sound_pain2;
static cached_soundindex sound_die;
static cached_soundindex sound_sight;
static cached_soundindex sound_search;
static cached_soundindex sound_hook_launch;
static cached_soundindex sound_hook_hit;
static cached_soundindex sound_hook_heal;
static cached_soundindex sound_hook_retract;
// PMM - commander sounds
static int commander_sound_idle1;
static int commander_sound_pain1;
static int commander_sound_pain2;
static int commander_sound_die;
static int commander_sound_sight;
static int commander_sound_search;
static int commander_sound_hook_launch;
static int commander_sound_hook_hit;
static int commander_sound_hook_heal;
static int commander_sound_hook_retract;
static int commander_sound_spawn;
static cached_soundindex commander_sound_idle1;
static cached_soundindex commander_sound_pain1;
static cached_soundindex commander_sound_pain2;
static cached_soundindex commander_sound_die;
static cached_soundindex commander_sound_sight;
static cached_soundindex commander_sound_search;
static cached_soundindex commander_sound_hook_launch;
static cached_soundindex commander_sound_hook_hit;
static cached_soundindex commander_sound_hook_heal;
static cached_soundindex commander_sound_hook_retract;
static cached_soundindex commander_sound_spawn;
constexpr const char *default_reinforcements = "monster_soldier_light 1;monster_soldier 2;monster_soldier_ss 2;monster_infantry 3;monster_gunner 4;monster_medic 5;monster_gladiator 6";
constexpr int32_t default_monster_slots_base = 3;
@@ -199,30 +199,34 @@ void abortHeal(edict_t *self, bool change_frame, bool gib, bool mark)
int hurt;
constexpr vec3_t pain_normal = { 0, 0, 1 };
cleanupHealTarget(self->enemy);
// gib em!
if ((mark) && (self->enemy) && (self->enemy->inuse))
if (self->enemy && self->enemy->inuse)
{
// if the first badMedic slot is filled by a medic, skip it and use the second one
if ((self->enemy->monsterinfo.badMedic1) && (self->enemy->monsterinfo.badMedic1->inuse) && (!strncmp(self->enemy->monsterinfo.badMedic1->classname, "monster_medic", 13)))
{
self->enemy->monsterinfo.badMedic2 = self;
}
else
{
self->enemy->monsterinfo.badMedic1 = self;
}
}
if ((gib) && (self->enemy) && (self->enemy->inuse))
{
if (self->enemy->gib_health)
hurt = -self->enemy->gib_health;
else
hurt = 500;
cleanupHealTarget(self->enemy);
T_Damage(self->enemy, self, self, vec3_origin, self->enemy->s.origin,
pain_normal, hurt, 0, DAMAGE_NONE, MOD_UNKNOWN);
// gib em!
if (mark)
{
// if the first badMedic slot is filled by a medic, skip it and use the second one
if ((self->enemy->monsterinfo.badMedic1) && (self->enemy->monsterinfo.badMedic1->inuse) && (!strncmp(self->enemy->monsterinfo.badMedic1->classname, "monster_medic", 13)))
{
self->enemy->monsterinfo.badMedic2 = self;
}
else
{
self->enemy->monsterinfo.badMedic1 = self;
}
}
if (gib)
{
if (self->enemy->gib_health)
hurt = -self->enemy->gib_health;
else
hurt = 500;
T_Damage(self->enemy, self, self, vec3_origin, self->enemy->s.origin,
pain_normal, hurt, 0, DAMAGE_NONE, MOD_UNKNOWN);
}
}
// clean up self
@@ -632,21 +636,6 @@ void medic_fire_blaster(edict_t *self)
}
else
{
static constexpr vec3_t hb_offsets[] = {
{ 33.0f, 12.5f, 15.0f },
{ 32.4f, 11.2f, 15.0f },
{ 35.6f, 7.4f, 15.0f },
{ 34.0f, 4.1f, 15.0f },
{ 36.6f, 1.0f, 15.0f },
{ 34.7f, -1.9f, 15.0f },
{ 36.6f, -0.5f, 15.0f },
{ 34.2f, 2.8f, 15.0f },
{ 36.5f, 3.8f, 15.0f },
{ 33.5f, 6.9f, 15.0f },
{ 32.7f, 9.9f, 15.0f },
{ 34.5f, 11.0f, 15.0f }
};
effect = (self->s.frame % 4) ? EF_NONE : EF_HYPERBLASTER;
mz = static_cast<monster_muzzleflash_id_t>(((self->mass > 400) ? MZ2_MEDIC_HYPERBLASTER2_1 : MZ2_MEDIC_HYPERBLASTER1_1) + (self->s.frame - FRAME_attack19));
}
@@ -1232,10 +1221,8 @@ void medic_spawngrows(edict_t *self)
{
offset = reinforcement_position[count];
if (self->s.scale)
offset *= self->s.scale;
startpoint = M_ProjectFlashSource(self, offset, f, r);
// a little off the ground
startpoint[2] += 10 * (self->s.scale ? self->s.scale : 1.0f);
@@ -1277,9 +1264,6 @@ void medic_finish_spawn(edict_t *self)
auto &reinforcement = self->monsterinfo.reinforcements.reinforcements[self->monsterinfo.chosen_reinforcements[count]];
offset = reinforcement_position[count];
if (self->s.scale)
offset *= self->s.scale;
startpoint = M_ProjectFlashSource(self, offset, f, r);
// a little off the ground
@@ -1595,17 +1579,17 @@ void SP_monster_medic(edict_t *self)
self->s.skinnum = 2;
// commander sounds
commander_sound_idle1 = gi.soundindex("medic_commander/medidle.wav");
commander_sound_pain1 = gi.soundindex("medic_commander/medpain1.wav");
commander_sound_pain2 = gi.soundindex("medic_commander/medpain2.wav");
commander_sound_die = gi.soundindex("medic_commander/meddeth.wav");
commander_sound_sight = gi.soundindex("medic_commander/medsght.wav");
commander_sound_search = gi.soundindex("medic_commander/medsrch.wav");
commander_sound_hook_launch = gi.soundindex("medic_commander/medatck2c.wav");
commander_sound_hook_hit = gi.soundindex("medic_commander/medatck3a.wav");
commander_sound_hook_heal = gi.soundindex("medic_commander/medatck4a.wav");
commander_sound_hook_retract = gi.soundindex("medic_commander/medatck5a.wav");
commander_sound_spawn = gi.soundindex("medic_commander/monsterspawn1.wav");
commander_sound_idle1.assign("medic_commander/medidle.wav");
commander_sound_pain1.assign("medic_commander/medpain1.wav");
commander_sound_pain2.assign("medic_commander/medpain2.wav");
commander_sound_die.assign("medic_commander/meddeth.wav");
commander_sound_sight.assign("medic_commander/medsght.wav");
commander_sound_search.assign("medic_commander/medsrch.wav");
commander_sound_hook_launch.assign("medic_commander/medatck2c.wav");
commander_sound_hook_hit.assign("medic_commander/medatck3a.wav");
commander_sound_hook_heal.assign("medic_commander/medatck4a.wav");
commander_sound_hook_retract.assign("medic_commander/medatck5a.wav");
commander_sound_spawn.assign("medic_commander/monsterspawn1.wav");
gi.soundindex("tank/tnkatck3.wav");
const char *reinforcements = default_reinforcements;
@@ -1625,16 +1609,16 @@ void SP_monster_medic(edict_t *self)
}
else
{
sound_idle1 = gi.soundindex("medic/idle.wav");
sound_pain1 = gi.soundindex("medic/medpain1.wav");
sound_pain2 = gi.soundindex("medic/medpain2.wav");
sound_die = gi.soundindex("medic/meddeth1.wav");
sound_sight = gi.soundindex("medic/medsght1.wav");
sound_search = gi.soundindex("medic/medsrch1.wav");
sound_hook_launch = gi.soundindex("medic/medatck2.wav");
sound_hook_hit = gi.soundindex("medic/medatck3.wav");
sound_hook_heal = gi.soundindex("medic/medatck4.wav");
sound_hook_retract = gi.soundindex("medic/medatck5.wav");
sound_idle1.assign("medic/idle.wav");
sound_pain1.assign("medic/medpain1.wav");
sound_pain2.assign("medic/medpain2.wav");
sound_die.assign("medic/meddeth1.wav");
sound_sight.assign("medic/medsght1.wav");
sound_search.assign("medic/medsrch1.wav");
sound_hook_launch.assign("medic/medatck2.wav");
sound_hook_hit.assign("medic/medatck3.wav");
sound_hook_heal.assign("medic/medatck4.wav");
sound_hook_retract.assign("medic/medatck5.wav");
gi.soundindex("medic/medatck1.wav");
self->s.skinnum = 0;