+#include "tuba.qh"
#ifndef IMPLEMENTATION
CLASS(Tuba, Weapon)
-/* impulse */ ATTRIB(Tuba, impulse, int, 1)
+/* impulse */ ATTRIB(Tuba, impulse, int, 1);
/* flags */ ATTRIB(Tuba, spawnflags, int, WEP_FLAG_HIDDEN | WEP_TYPE_SPLASH);
/* rating */ ATTRIB(Tuba, bot_pickupbasevalue, float, BOT_PICKUP_RATING_MID);
/* color */ ATTRIB(Tuba, wpcolor, vector, '0 1 0');
/* modelname */ ATTRIB(Tuba, mdl, string, "tuba");
-#ifndef MENUQC
+#ifdef GAMEQC
/* model */ ATTRIB(Tuba, m_model, Model, MDL_TUBA_ITEM);
#endif
/* crosshair */ ATTRIB(Tuba, w_crosshair, string, "gfx/crosshairtuba");
}
}
+void tuba_instrument_send(entity this, int instr);
METHOD(Tuba, wr_setup, void(Tuba this, entity actor))
{
actor.ammo_field = ammo_none;
actor.tuba_instrument = 0;
+ tuba_instrument_send(actor, actor.tuba_instrument);
}
#endif
string s = (i == 0) ? "tuba" :
(i == 1) ? "akordeon" :
"kleinbottle" ;
+ viewmodel.tuba_instrument = i;
CL_WeaponEntity_SetModel(viewmodel, s, true);
}
#endif
void tuba_instrument_send(entity this, int instr)
{
msg_entity = this;
+ if (!IS_REAL_CLIENT(this))
+ return;
int chan = MSG_ONE;
WriteHeader(chan, tuba_instrument);
WriteByte(chan, instr);
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
const int TUBA_MAX = 27;
const int TUBA_INSTRUMENTS = 3;
-entityclass(Tuba);
-class(Tuba) .int note;
-class(Tuba) .bool tuba_attenuate;
-class(Tuba) .float tuba_volume;
-class(Tuba) .float tuba_volume_initial;
-class(Tuba) .int tuba_instrument;
-
int Tuba_PitchStep;
void tubasound(entity e, bool restart)