+ tuba_instrument_send(actor, actor.tuba_instrument);
+ W_SetupShot(actor, weaponentity, false, 0, SND_Null, 0, 0);
+ Send_Effect(EFFECT_TELEPORT, w_shotorg, '0 0 0', 1);
+ actor.(weaponentity).state = WS_INUSE;
+ weapon_thinkf(actor, weaponentity, WFRAME_RELOAD, 0.5, w_ready);
+ }
+}
+#endif
+
+#ifdef SVQC
+
+// infinite ammo
+METHOD(Tuba, wr_checkammo1, bool(Tuba this, entity actor)) { return true; }
+METHOD(Tuba, wr_checkammo2, bool(Tuba this, entity actor)) { return true; }
+
+METHOD(Tuba, wr_suicidemessage, Notification(Tuba this))
+{
+ if (w_deathtype & HITTYPE_BOUNCE)
+ return WEAPON_KLEINBOTTLE_SUICIDE;
+ else if (w_deathtype & HITTYPE_SECONDARY)
+ return WEAPON_ACCORDEON_SUICIDE;
+ else
+ return WEAPON_TUBA_SUICIDE;
+}
+METHOD(Tuba, wr_killmessage, Notification(Tuba this))
+{
+ if (w_deathtype & HITTYPE_BOUNCE)
+ return WEAPON_KLEINBOTTLE_MURDER;
+ else if (w_deathtype & HITTYPE_SECONDARY)
+ return WEAPON_ACCORDEON_MURDER;
+ else
+ return WEAPON_TUBA_MURDER;
+}
+
+#elif defined(CSQC)
+
+METHOD(Tuba, wr_viewmodel, string(Tuba this, entity wep))
+{
+ return (wep.tuba_instrument == 0) ? "tuba" :
+ (wep.tuba_instrument == 1) ? "akordeon" :
+ "kleinbottle";
+}
+
+#endif
+
+#ifdef CSQC
+
+#define TUBA_STARTNOTE(i, n) _Sound_fixpath(W_Sound(strcat("tuba", (i ? ftos(i) : ""), "_loopnote", ftos(n))))
+
+const int TUBA_MIN = -18;
+const int TUBA_MAX = 27;
+const int TUBA_INSTRUMENTS = 3;
+
+int Tuba_PitchStep;
+
+void tubasound(entity e, bool restart)
+{
+ string snd1 = string_null;
+ if (Tuba_PitchStep) {
+ float vol1 = 1;
+ float speed1 = 1;
+ string snd2 = string_null;
+ float vol2 = 0;
+ float speed2 = 1;
+
+ int m = pymod(e.note, Tuba_PitchStep);
+ if (m) {
+ if (e.note - m < TUBA_MIN) {
+ if (restart) {
+ snd1 = TUBA_STARTNOTE(e.tuba_instrument, e.note - m + Tuba_PitchStep);
+ }
+ speed1 = pow(2.0, (m - Tuba_PitchStep) / 12.0);
+ } else if (e.note - m + Tuba_PitchStep > TUBA_MAX) {
+ if (restart) {
+ snd1 = TUBA_STARTNOTE(e.tuba_instrument, e.note - m);
+ }
+ speed1 = pow(2.0, m / 12.0);
+ } else {
+ if (restart) {
+ snd1 = TUBA_STARTNOTE(e.tuba_instrument, e.note - m);
+ }
+ vol1 = cos(M_PI_2 * m / Tuba_PitchStep);
+ speed1 = pow(2.0, m / 12.0);
+ if (restart) {
+ snd2 = TUBA_STARTNOTE(e.tuba_instrument, e.note - m + Tuba_PitchStep);