8#define MAX_TUBANOTES 32
16 if (n > pl.(weaponentity).tuba_lastnotes_cnt)
20 if (instrument >= 0 && pl.(weaponentity).tuba_instrument != instrument)
25 bool nolength =
false;
26 for (i = 0; i < n; ++i)
37 if (ignorepitch && i == 0)
38 pitchshift = np - v.z;
39 else if (v.z + pitchshift != np)
49 mmin = 240 / maxtempo;
53 mmax = 240 / mintempo;
59 for (i = 0; i < n; ++i)
63 ti -= 1 / (ai -
floor(ai));
65 for (
int j = i + 1; j < n; ++j)
85 mmin =
max(mmin, (vi.x - vj.y) / (ti - tj));
86 mmax =
min(mmax, (vi.y - vj.x) / (ti - tj));
107 if (actor.(weaponentity).tuba_note ==
this)
122 bprint(
strcat(
"\{1}\{13}* ^3", actor.netname,
"^3 played on the @!#%'n Tuba: ^7", s,
"\n"));
125 bprint(
strcat(
"\{1}\{13}* ^3", actor.netname,
"^3 played on the @!#%'n Accordeon: ^7", s,
"\n"));
128 bprint(
strcat(
"\{1}\{13}* ^3", actor.netname,
"^3 played on the @!#%'n Klein Bottle: ^7", s,
"\n"));
140 else if (
CS(pl).
movement.x > 0) movestate += 3;
142 else if (
CS(pl).
movement.y > 0) movestate += 1;
156 case 1: note = -6;
break;
157 case 2: note = -5;
break;
158 case 3: note = -4;
break;
159 case 4: note = +5;
break;
161 case 5: note = 0;
break;
162 case 6: note = +2;
break;
163 case 7: note = +3;
break;
164 case 8: note = +4;
break;
165 case 9: note = -1;
break;
186 if (pl.clientcolors & 1)
241 v = this.
origin - (it.origin + it.view_ofs);
242 vol0 =
max(0, 1 -
vlen(v) * dist_mult);
244 v = this.
realowner.origin - (it.origin + it.view_ofs);
245 vol1 =
max(0, 1 -
vlen(v) * dist_mult);
247 if (
fabs(vol0 - vol1) > 0.005)
253 if (dir0 * dir1 < 0.9994)
267 if (actor.(weaponentity).tuba_instrument & 1)
269 if (actor.(weaponentity).tuba_instrument & 2)
272 W_SetupShot(actor, weaponentity,
false, 2, SND_Null, 0,
WEP_CVAR(WEP_TUBA, damage), hittype | WEP_TUBA.m_id);
274 if (actor.(weaponentity).tuba_note
275 && (actor.(weaponentity).tuba_note.cnt != n || actor.(weaponentity).tuba_note.tuba_instrument != actor.(weaponentity).tuba_instrument))
278 if (!actor.(weaponentity).tuba_note)
281 note.weaponentity_fld = weaponentity;
283 note.owner = note.realowner = actor;
287 note.nextthink =
time;
288 note.spawnshieldtime =
time;
302 hittype | WEP_TUBA.m_id,
307 if (
time > actor.(weaponentity).tuba_smoketime)
311 if (actor.(weaponentity).tuba_instrument == 1)
313 else if (actor.(weaponentity).tuba_instrument == 2)
348 if (actor.(weaponentity).tuba_note)
349 if (!(fire & (1 | 2)))
363 if (actor.(weaponentity).state !=
WS_READY)
366 switch (actor.(weaponentity).tuba_instrument)
374 actor.(weaponentity).
weaponname =
"kleinbottle";
382 if (actor.(weaponentity).tuba_instrument & 1)
384 if (actor.(weaponentity).tuba_instrument & 2)
386 W_SetupShot(actor, weaponentity,
false, 0, SND_Null, 0, 0, hittype | WEP_TUBA.m_id);
404 return WEAPON_KLEINBOTTLE_SUICIDE;
406 return WEAPON_ACCORDEON_SUICIDE;
408 return WEAPON_TUBA_SUICIDE;
413 return WEAPON_KLEINBOTTLE_MURDER;
415 return WEAPON_ACCORDEON_MURDER;
417 return WEAPON_TUBA_MURDER;
425 return (wep.tuba_instrument == 0) ?
"tuba" :
426 (wep.tuba_instrument == 1) ?
"akordeon" :
430#define TUBA_STARTNOTE(i, n) _Sound_fixpath(W_Sound(strcat("tuba", (i ? ftos(i) : ""), "_loopnote", ftos(n))))
462 speed1 = 2.0 ** (m / 12.0);
469 speed1 = 2.0 ** (m / 12.0);
495 this.tuba_volume -=
frametime * this.tuba_volume_initial / f;
497 this.tuba_volume = 0;
499 if (this.tuba_volume <= 0)
516 this.
enemy.tuba_volume_initial = this.
enemy.tuba_volume;
517 this.
enemy.note = this.note;
548 this.
enemy.enemy =
new(tuba_note_2);
552 this.
enemy.tuba_attenuate = att;
566 if (this.
enemy.enemy)
567 setorigin(this.
enemy.enemy,
this.enemy.origin);
587 LOG_WARN(
"requested pitch shifting, but not supported by this engine build");
604 PAR(_(
"The %s is a unique weapon that makes the ears of nearby enemies bleed by playing awful sounds, also slightly knocking them back."),
COLORED_NAME(
this));
605 PAR(_(
"The secondary fire works the same way, playing a higher pitch."));
606 PAR(_(
"The only ammo it needs to operate is the breath from your lungs."));
607 PAR(_(
"Since your enemies need to be close by to hear your rubbish music, the %s is only effective at very close ranges."),
COLORED_NAME(
this));
608 PAR(_(
"The pitch the %s plays depends on the movement keys pressed."),
COLORED_NAME(
this));
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
#define COLORED_NAME(this)
#define PHYS_INPUT_BUTTON_CROUCH(s)
#define PHYS_INPUT_BUTTON_JUMP(s)
#define PHYS_INPUT_BUTTON_ATCK(s)
#define PHYS_INPUT_BUTTON_ATCK2(s)
float W_WeaponRateFactor(entity this)
float RadiusDamage(entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float forceintensity, int deathtype,.entity weaponentity, entity directhitentity)
const int HITTYPE_SECONDARY
void Send_Effect(entity eff, vector eff_loc, vector eff_vel, int eff_cnt)
#define NET_HANDLE(id, param)
#define WriteHeader(to, id)
void Net_LinkEntity(entity e, bool docull, float dt, bool(entity this, entity to, int sendflags) sendfunc)
string trigger_magicear_processmessage_forallears(entity source, float teamsay, entity privatesay, string msgin)
float pymod(float e, float f)
Pythonic mod: TODO: %% operator?
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
entity Notification
always last
#define METHOD(cname, name, prototype)
#define _sound(e, c, s, v, a)
#define sound(e, c, s, v, a)
bool sound_allowed(int to, entity e)
ClientState CS(Client this)
#define PRECACHE(func)
directly after STATIC_INIT_LATE
#define PAR(...)
Adds an individually translatable paragraph to PAGE_TEXT without having to deal with strcat and sprin...
float speed2
monster run speed
#define W_SetupShot(ent, wepent, antilag, recoil, snd, chan, maxdamage, deathtype)
int W_Tuba_GetNote(entity pl, int hittype)
void Ent_TubaNote_UpdateSound(entity this)
void Ent_TubaNote_StopSound(entity this)
void Ent_TubaNote_Think(entity this)
void tubasound(entity e, bool restart)
vector tuba_lastnotes[MAX_TUBANOTES]
bool W_Tuba_HasPlayed(entity pl,.entity weaponentity, string melody, int instrument, bool ignorepitch, float mintempo, float maxtempo)
const int TUBA_INSTRUMENTS
bool W_Tuba_NoteSendEntity(entity this, entity to, int sf)
void W_Tuba_NoteOn(entity actor,.entity weaponentity, float hittype)
void W_Tuba_NoteOff(entity this)
void W_Tuba_NoteThink(entity this)
#define TUBA_STARTNOTE(i, n)
float tuba_lastnotes_last
float autocvar_cl_tuba_fadetime
float autocvar_cl_tuba_attenuation
float autocvar_cl_tuba_pitchstep
float autocvar_cl_tuba_volume
float autocvar_snd_soundradius
#define IS_REAL_CLIENT(v)
#define FOREACH_CLIENT(cond, body)
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
string W_Guide_Keybinds(Weapon wep)
string W_Guide_DPS_onlyOne_unnamed(string name)
#define WEP_CVAR(wep, name)
const int WS_READY
idle frame
const int WS_INUSE
fire state
void weapon_thinkf(entity actor,.entity weaponentity, WFRAME fr, float t, void(Weapon thiswep, entity actor,.entity weaponentity, int fire) func)
bool weapon_prepareattack(Weapon thiswep, entity actor,.entity weaponentity, bool secondary, float attacktime)
void w_ready(Weapon thiswep, entity actor,.entity weaponentity, int fire)