float CH_TRIGGER2_SINGLE = 16;
#endif
+#ifdef LEGACY_CHANS
// this assignment must match menu/xonotic/dialog_settings_misc.c!
float CHAN_AUTO = 0;
// on world: announcers, ... INFO
// on players: player sounds PLAYER
// on entities: player sounds PLAYER
// on csqc: UNUSED
+#endif
float ATTN_NONE = 0;
float ATTN_MIN = 0.015625;
(time > ent.prevstrengthsoundattempt + autocvar_sv_strengthsound_antispam_refire_threshold)
) // prevent insane sound spam
{
- sound(ent, CH_ITEMS, "weapons/strength_fire.wav", VOL_BASE, ATTN_NORM);
+ sound(ent, CH_TRIGGER, "weapons/strength_fire.wav", VOL_BASE, ATTN_NORM);
ent.prevstrengthsound = time;
}
ent.prevstrengthsoundattempt = time;
}
}
- sound (other, CH_ITEMS, self.noise2, VOL_BASE, ATTN_NONE);
+ sound (other, CH_TRIGGER, self.noise2, VOL_BASE, ATTN_NONE);
WaypointSprite_DetachCarrier(other);
if(self.speedrunning)
FakeTimeLimit(other, -1);
self.dropperid = other.playerid;
PlayerScore_Add(other, SP_CTF_PICKUPS, 1);
LogCTF("steal", self.team, other);
- sound (other, CH_ITEMS, self.noise, VOL_BASE, ATTN_NONE);
+ sound (other, CH_TRIGGER, self.noise, VOL_BASE, ATTN_NONE);
FOR_EACH_PLAYER(player)
if(player.team == self.team)
}
PlayerScore_Add(other, SP_CTF_RETURNS, 1);
LogCTF("return", self.team, other);
- sound (other, CH_ITEMS, self.noise1, VOL_BASE, ATTN_NONE);
+ sound (other, CH_TRIGGER, self.noise1, VOL_BASE, ATTN_NONE);
ReturnFlag(self);
}
else if (!other.flagcarried && (other.playerid != self.dropperid || time > self.ctf_droptime + autocvar_g_balance_ctf_delay_collect))
UpdateFrags(other, f);
PlayerScore_Add(other, SP_CTF_PICKUPS, 1);
LogCTF("pickup", self.team, other);
- sound (other, CH_ITEMS, self.noise, VOL_BASE, ATTN_NONE);
+ sound (other, CH_TRIGGER, self.noise, VOL_BASE, ATTN_NONE);
FOR_EACH_PLAYER(player)
if(player.team == self.team)
if (head.noise != "")
if(self.enemy)
- sound(self.enemy, CH_ITEMS, head.noise, VOL_BASE, ATTN_NORM);
+ sound(self.enemy, CH_TRIGGER, head.noise, VOL_BASE, ATTN_NORM);
else
sound(self, CH_TRIGGER_SINGLE, head.noise, VOL_BASE, ATTN_NORM);
if (head.noise1 != "")
}
if (self.noise)
- sound (self.enemy, CH_ITEMS, self.noise, VOL_BASE, ATTN_NORM);
+ sound (self.enemy, CH_TRIGGER, self.noise, VOL_BASE, ATTN_NORM);
// don't trigger again until reset
self.takedamage = DAMAGE_NO;
{
other.health = min(other.health + self.health, self.max_health);
other.pauserothealth_finished = max(other.pauserothealth_finished, time + autocvar_g_balance_pause_health_rot);
- sound (other, CH_ITEMS, self.noise, VOL_BASE, ATTN_NORM);
+ sound (other, CH_TRIGGER, self.noise, VOL_BASE, ATTN_NORM);
}
}
}
{
other.gravity = g;
if(self.noise != "")
- sound (other, CH_ITEMS, self.noise, VOL_BASE, ATTN_NORM);
+ sound (other, CH_TRIGGER, self.noise, VOL_BASE, ATTN_NORM);
UpdateCSQCProjectile(self.owner);
}
};
Send_KillNotification(other.netname, "", "", KA_PICKUPBALL, MSG_KA);
WriteByte(MSG_BROADCAST, SVC_CENTERPRINT);
WriteString(MSG_BROADCAST, strcat("\n\n", other.netname, "^7 has picked up the ball!\n"));
- sound(self.owner, CH_ITEMS, "keepaway/pickedup.wav", VOL_BASE, ATTN_NONE); // ATTN_NONE (it's a sound intended to be heard anywhere)
+ sound(self.owner, CH_TRIGGER, "keepaway/pickedup.wav", VOL_BASE, ATTN_NONE); // ATTN_NONE (it's a sound intended to be heard anywhere)
// scoring
PlayerScore_Add(other, SP_KEEPAWAY_PICKUPS, 1);
Send_KillNotification(plyr.netname, "", "", KA_DROPBALL, MSG_KA);
WriteByte(MSG_BROADCAST, SVC_CENTERPRINT);
WriteString(MSG_BROADCAST, strcat("\n\n", plyr.netname, "^7 has dropped the ball!\n"));
- sound(plyr, CH_ITEMS, "keepaway/dropped.wav", VOL_BASE, ATTN_NONE); // ATTN_NONE (it's a sound intended to be heard anywhere)
+ sound(plyr, CH_TRIGGER, "keepaway/dropped.wav", VOL_BASE, ATTN_NONE); // ATTN_NONE (it's a sound intended to be heard anywhere)
// scoring
// PlayerScore_Add(plyr, SP_KEEPAWAY_DROPS, 1); Not anymore, this is 100% the same as pickups and is useless.
void kh_Key_Collect(entity key, entity player) //a player picks up a dropped key
{
- sound(player, CH_ITEMS, kh_sound_collect, VOL_BASE, ATTN_NORM);
+ sound(player, CH_TRIGGER, kh_sound_collect, VOL_BASE, ATTN_NORM);
if(key.kh_dropperteam != player.team)
{
{
if(self.siren_time < time)
{
- sound(self.owner, CH_ITEMS, kh_sound_alarm, VOL_BASE, ATTN_NORM); // play a simple alarm
+ sound(self.owner, CH_TRIGGER, kh_sound_alarm, VOL_BASE, ATTN_NORM); // play a simple alarm
self.siren_time = time + 2.5; // repeat every 2.5 seconds
}
key.pushltime = time + autocvar_g_balance_keyhunt_protecttime;
key.kh_dropperteam = key.team;
- sound(player, CH_ITEMS, kh_sound_drop, VOL_BASE, ATTN_NORM);
+ sound(player, CH_TRIGGER, kh_sound_drop, VOL_BASE, ATTN_NORM);
}
void kh_Key_DropAll(entity player, float suicide) // runs whenever a player dies
if(suicide)
key.kh_dropperteam = player.team;
}
- sound(player, CH_ITEMS, kh_sound_drop, VOL_BASE, ATTN_NORM);
+ sound(player, CH_TRIGGER, kh_sound_drop, VOL_BASE, ATTN_NORM);
}
}
if(!attacker.ballcarried)
{
LogNB("stole", attacker);
- sound (other, CH_ITEMS, ball.noise2, VOL_BASE, ATTN_NORM);
+ sound (other, CH_TRIGGER, ball.noise2, VOL_BASE, ATTN_NORM);
if(attacker.team == other.team && time > attacker.teamkill_complain)
{
if (!pickedup)
return 0;
- sound (player, CH_ITEMS, item.item_pickupsound, VOL_BASE, ATTN_NORM);
+ sound (player, CH_TRIGGER, item.item_pickupsound, VOL_BASE, ATTN_NORM);
if (_switchweapon)
if (player.switchweapon != w_getbestweapon(player))
W_SwitchWeapon_Force(player, w_getbestweapon(player));
if(v1 <= v0 - t)
{
if(snd_decr != "")
- sound (e, CH_ITEMS, snd_decr, VOL_BASE, ATTN_NORM);
+ sound (e, CH_TRIGGER, snd_decr, VOL_BASE, ATTN_NORM);
}
else if(v0 >= v0 + t)
{
if(snd_incr != "")
- sound (e, CH_ITEMS, snd_incr, VOL_BASE, ATTN_NORM);
+ sound (e, CH_TRIGGER, snd_incr, VOL_BASE, ATTN_NORM);
}
}
{
// flash when activated
pointparticles(particleeffectnum("jumppad_activate"), other.origin, other.velocity, 1);
- sound (other, CH_ITEMS, self.noise, VOL_BASE, ATTN_NORM);
+ sound (other, CH_TRIGGER, self.noise, VOL_BASE, ATTN_NORM);
self.pushltime = time + 0.2;
}
local float ct;