#define TUBA_STARTNOTE(n) strcat((checkextension("DP_SND_SETPARAMS") ? "weapons/tuba_loopnote" : "weapons/tuba_note"), ftos(n), ".wav")
.float cnt; // note
+.float attenuate; // if set, attenuate it
void Ent_TubaNote_Think()
{
remove(self);
}
else
- sound(self, CHAN_PROJECTILE, "", self.cnt, cvar("g_balance_tuba_attenuation"));
+ sound(self, CHAN_PROJECTILE, "", self.cnt, self.attenuate * cvar("g_balance_tuba_attenuation"));
}
void Ent_TubaNote_UpdateSound()
{
self.enemy.cnt = bound(0, VOL_BASE * cvar("g_balance_tuba_volume"), 1);
self.enemy.count = self.enemy.cnt;
- sound(self.enemy, CHAN_PROJECTILE, TUBA_STARTNOTE(self.cnt), self.enemy.cnt, cvar("g_balance_tuba_attenuation"));
+ sound(self.enemy, CHAN_PROJECTILE, TUBA_STARTNOTE(self.cnt), self.enemy.cnt, self.attenuate * cvar("g_balance_tuba_attenuation"));
}
void Ent_TubaNote_StopSound()
self.enemy.origin_y = ReadCoord();
self.enemy.origin_z = ReadCoord();
setorigin(self.enemy, self.enemy.origin);
+ self.enemy.attenuate = ReadByte();
}
self.think = Ent_TubaNote_StopSound;
self.entremove = Ent_TubaNote_StopSound;
WriteCoord(MSG_ENTITY, self.origin_x);
WriteCoord(MSG_ENTITY, self.origin_y);
WriteCoord(MSG_ENTITY, self.origin_z);
+ WriteByte(MSG_ENTITY, self.owner != to);
}
return TRUE;
}
void W_Tuba_NoteThink()
{
- float needchange, dist_mult;
+ float dist_mult;
float vol0, vol1;
vector dir0, dir1;
vector v;
}
self.nextthink = time;
dist_mult = cvar("g_balance_tuba_attenuation") / cvar("snd_soundradius");
- needchange = 0;
FOR_EACH_REALCLIENT(e)
if(e != self.owner)
{