Make our sentry class use soundDefs

This commit is contained in:
Marco Cawthorne 2022-08-05 14:25:01 -07:00
parent ddaf0f533a
commit e3c7d8a1a2
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
4 changed files with 15 additions and 4 deletions

View File

@ -87,7 +87,7 @@ item_armor::Touch(entity eToucher)
return; return;
int ap; int ap;
int tp; int tp = 0;
/* get remaining points */ /* get remaining points */
ap = pl.m_iMaxArmor - pl.armor; ap = pl.m_iMaxArmor - pl.armor;
@ -198,4 +198,4 @@ item_armor3(void)
precache_model("models/r_armor.mdl"); precache_model("models/r_armor.mdl");
spawnfunc_item_armor(); spawnfunc_item_armor();
self.classname = "item_armor3"; self.classname = "item_armor3";
} }

View File

@ -42,14 +42,14 @@ TFCSentry::Think(void)
m_eHead.SetBoneControl2(0.5f); m_eHead.SetBoneControl2(0.5f);
if (m_flNextIdleSound < time) { if (m_flNextIdleSound < time) {
sound(this, CHAN_VOICE, "weapons/turridle.wav", 1.0f, ATTN_NORM); Sound_Play(this, CHAN_VOICE, "turret_tfc.idle_noise");
m_flNextIdleSound = time + 10.0f; m_flNextIdleSound = time + 10.0f;
} }
if (t) if (t)
m_state = SENTRY_ALERTED; m_state = SENTRY_ALERTED;
} else if (m_state == SENTRY_ALERTED) { } else if (m_state == SENTRY_ALERTED) {
sound(this, CHAN_VOICE, "weapons/turrspot.wav", 1.0f, ATTN_NORM); Sound_Play(this, CHAN_VOICE, "turret_tfc.target_spotted");
m_state = SENTRY_SHOOTING; m_state = SENTRY_SHOOTING;
} else if (m_state == SENTRY_SHOOTING) { } else if (m_state == SENTRY_SHOOTING) {
// shoot things // shoot things

View File

@ -24,6 +24,8 @@ void
Game_Worldspawn(void) Game_Worldspawn(void)
{ {
forceinfokey(world, "areadefs", "0"); forceinfokey(world, "areadefs", "0");
Sound_Precache("turret_tfc.idle_noise");
Sound_Precache("turret_tfc.target_spotted");
Sound_Precache("ammo.pickup"); Sound_Precache("ammo.pickup");
Sound_Precache("ammo.respawn"); Sound_Precache("ammo.respawn");
Sound_Precache("player.fall"); Sound_Precache("player.fall");

View File

@ -0,0 +1,9 @@
turret_tfc.idle_noise
{
sample "weapons/turridle.wav"
}
turret_tfc.target_spotted
{
sample "weapons/turrspot.wav"
}