added pickup sounds for health and armor. added sounds for weapon respawn

This commit is contained in:
Magnus Auvinen 2007-07-29 16:44:30 +00:00
parent c6b013443d
commit 2cb87d92ba
2 changed files with 26 additions and 0 deletions

View file

@ -122,6 +122,24 @@ sounds {
"data/audio/hook_attach-02.wav" "data/audio/hook_attach-02.wav"
"data/audio/hook_attach-03.wav" "data/audio/hook_attach-03.wav"
} }
pickup_health {
"data/audio/sfx_pickup_hrt-01.wav"
"data/audio/sfx_pickup_hrt-02.wav"
}
pickup_armor {
"data/audio/sfx_pickup_arm-01.wav"
"data/audio/sfx_pickup_arm-02.wav"
"data/audio/sfx_pickup_arm-03.wav"
"data/audio/sfx_pickup_arm-04.wav"
}
weapon_spawn {
"data/audio/sfx_spawn_wpn-01.wav"
"data/audio/sfx_spawn_wpn-02.wav"
"data/audio/sfx_spawn_wpn-03.wav"
}
} }

View file

@ -1393,7 +1393,13 @@ void powerup::tick()
if(spawntick > 0) if(spawntick > 0)
{ {
if(server_tick() > spawntick) if(server_tick() > spawntick)
{
// respawn
spawntick = -1; spawntick = -1;
if(type == POWERUP_WEAPON)
create_sound(pos, SOUND_WEAPON_SPAWN, 0);
}
else else
return; return;
} }
@ -1409,6 +1415,7 @@ void powerup::tick()
case POWERUP_HEALTH: case POWERUP_HEALTH:
if(pplayer->health < data->playerinfo[gameobj.gametype].maxhealth) if(pplayer->health < data->playerinfo[gameobj.gametype].maxhealth)
{ {
create_sound(pos, SOUND_PICKUP_HEALTH, 0);
pplayer->health = min((int)data->playerinfo[gameobj.gametype].maxhealth, pplayer->health + data->powerupinfo[type].amount); pplayer->health = min((int)data->playerinfo[gameobj.gametype].maxhealth, pplayer->health + data->powerupinfo[type].amount);
respawntime = data->powerupinfo[type].respawntime; respawntime = data->powerupinfo[type].respawntime;
} }
@ -1416,6 +1423,7 @@ void powerup::tick()
case POWERUP_ARMOR: case POWERUP_ARMOR:
if(pplayer->armor < data->playerinfo[gameobj.gametype].maxarmor) if(pplayer->armor < data->playerinfo[gameobj.gametype].maxarmor)
{ {
create_sound(pos, SOUND_PICKUP_ARMOR, 0);
pplayer->armor = min((int)data->playerinfo[gameobj.gametype].maxarmor, pplayer->armor + data->powerupinfo[type].amount); pplayer->armor = min((int)data->playerinfo[gameobj.gametype].maxarmor, pplayer->armor + data->powerupinfo[type].amount);
respawntime = data->powerupinfo[type].respawntime; respawntime = data->powerupinfo[type].respawntime;
} }