Half-Life: Convert item_battery and item_healthkit to use sound shader

definitions instead of using sound() directly.
This commit is contained in:
Marco Cawthorne 2020-04-22 12:45:45 +02:00
parent 7793d52d3f
commit 0d3f271b21
6 changed files with 29 additions and 9 deletions

3
.gitignore vendored
View File

@ -9,6 +9,9 @@ src/shared/cstrike.new
src/client/hl2
src/server/hl2
src/shared/hl2
src/client/wastes
src/server/wastes
src/shared/wastes
*.lno
*.pk3
*.dat

View File

@ -18,7 +18,7 @@ games:
cd server/rewolf && $(MAKE)
cd client/gearbox && $(MAKE)
cd server/gearbox && $(MAKE)
mods:
cd client/cstrike && $(MAKE)
cd server/cstrike && $(MAKE)
@ -28,6 +28,6 @@ mods:
cd server/poke646 && $(MAKE)
cd client/hunger && $(MAKE)
cd server/hunger && $(MAKE)
plugins:
$(CC) plugins/chatsounds.src

View File

@ -50,7 +50,7 @@ void item_battery::touch(void)
}
Logging_Pickup(other, this, __NULL__);
sound(other, CHAN_ITEM, "items/gunpickup2.wav", 1, ATTN_NORM);
Sound_Play(other, CHAN_ITEM, "item.battery");
if (cvar("sv_playerslots") == 1) {
remove(self);
@ -72,12 +72,14 @@ void item_battery::Respawn(void)
think = __NULL__;
nextthink = -1;
sound(this, CHAN_ITEM, "items/suitchargeok1.wav", 1, ATTN_NORM, 150);
Sound_Play(this, CHAN_ITEM, "item.respawn");
droptofloor();
}
void item_battery::item_battery(void)
{
Sound_Precache("item.battery");
Sound_Precache("item.respawn");
model = "models/w_battery.mdl";
CBaseEntity::CBaseEntity();
item_healthkit::Respawn();

View File

@ -39,7 +39,7 @@ void item_healthkit::touch(void)
return;
}
Damage_Apply(other, this, -20, 0, DMG_GENERIC);
sound(this, CHAN_ITEM, "items/smallmedkit1.wav", 1, ATTN_NORM);
Sound_Play(this, CHAN_ITEM, "item.healthkit");
Logging_Pickup(other, this, __NULL__);
if (cvar("sv_playerslots") == 1) {
@ -63,14 +63,14 @@ void item_healthkit::Respawn(void)
think = __NULL__;
nextthink = -1;
sound(this, CHAN_ITEM, "items/suitchargeok1.wav", 1, ATTN_NORM, 150);
Sound_Play(this, CHAN_ITEM, "item.respawn");
droptofloor();
}
void item_healthkit::item_healthkit(void)
{
precache_sound("items/smallmedkit1.wav");
precache_sound("items/suitchargeok1.wav");
Sound_Precache("item.healthkit");
Sound_Precache("item.respawn");
model = "models/w_medkit.mdl";
CBaseEntity::CBaseEntity();
item_healthkit::Respawn();

View File

@ -98,7 +98,7 @@ w_bradnailer_shootnail(void)
Damage_Apply(other, self.owner, 15, WEAPON_BRADNAILER, DMG_GENERIC);
Sound_Play(self, CHAN_WEAPON, "weapon_bradnailer.hitbody");
} else {
Weapons_PlaySound(self, CHAN_WEAPON, "weapons/xbow_hit1.wav", 1, ATTN_NORM);
Sound_Play(self, CHAN_WEAPON, "weapon_crossbow.hit");
}
remove(self);
}

View File

@ -7,3 +7,18 @@ ammo.respawn
{
sample items/suitchargeok1.wav
}
item.battery
{
sample items/gunpickup2.wav
}
item.healthkit
{
sample items/smallmedkit1.wav
}
item.respawn
{
sample items/suitchargeok1.wav
}