/* wepimg */ ATTRIB(Tuba, model2, string, "weapontuba");
/* refname */ ATTRIB(Tuba, netname, string, "tuba");
/* xgettext:no-c-format */
-/* wepname */ ATTRIB(Tuba, message, string, _("@!#%'n Tuba"));
+/* wepname */ ATTRIB(Tuba, m_name, string, _("@!#%'n Tuba"));
ENDCLASS(Tuba)
REGISTER_WEAPON(TUBA, NEW(Tuba));
#endif
#ifdef IMPLEMENTATION
#ifdef SVQC
-void spawnfunc_weapon_tuba(void) { weapon_defaultspawnfunc(WEP_TUBA.m_id); }
+spawnfunc(weapon_tuba) { weapon_defaultspawnfunc(this, WEP_TUBA); }
bool W_Tuba_HasPlayed(entity pl, string melody, int instrument, bool ignorepitch, float mintempo, float maxtempo)
{
return note;
}
-bool W_Tuba_NoteSendEntity(entity to, int sf)
-{SELFPARAM();
+bool W_Tuba_NoteSendEntity(entity this, entity to, int sf)
+{
int f;
msg_entity = to;
}
}
- METHOD(Tuba, wr_aim, bool(entity thiswep))
+ METHOD(Tuba, wr_aim, void(entity thiswep))
{
// bots cannot play the Tuba well yet
// I think they should start with the recorder first
else
self.BUTTON_ATCK2 = 1;
}
-
- return true;
}
- METHOD(Tuba, wr_think, bool(entity thiswep, bool fire1, bool fire2))
+ METHOD(Tuba, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
{
- if(fire1)
- if(weapon_prepareattack(0, WEP_CVAR(tuba, refire)))
+ if(fire & 1)
+ if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR(tuba, refire)))
{
W_Tuba_NoteOn(0);
- //weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_tuba_animtime, w_ready);
- weapon_thinkf(WFRAME_IDLE, WEP_CVAR(tuba, animtime), w_ready);
+ //weapon_thinkf(actor, WFRAME_FIRE1, autocvar_g_balance_tuba_animtime, w_ready);
+ weapon_thinkf(actor, weaponentity, WFRAME_IDLE, WEP_CVAR(tuba, animtime), w_ready);
}
- if(fire2)
- if(weapon_prepareattack(1, WEP_CVAR(tuba, refire)))
+ if(fire & 2)
+ if(weapon_prepareattack(thiswep, actor, weaponentity, true, WEP_CVAR(tuba, refire)))
{
W_Tuba_NoteOn(HITTYPE_SECONDARY);
- //weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_tuba_animtime, w_ready);
- weapon_thinkf(WFRAME_IDLE, WEP_CVAR(tuba, animtime), w_ready);
+ //weapon_thinkf(actor, WFRAME_FIRE2, autocvar_g_balance_tuba_animtime, w_ready);
+ weapon_thinkf(actor, weaponentity, WFRAME_IDLE, WEP_CVAR(tuba, animtime), w_ready);
}
- if(self.tuba_note)
+ if(actor.tuba_note)
{
- if(!fire1 && !fire2)
+ if(!(fire & 1) && !(fire & 2))
{
- WITH(entity, self, self.tuba_note, W_Tuba_NoteOff());
+ WITH(entity, self, actor.tuba_note, W_Tuba_NoteOff());
}
}
-
- return true;
}
- METHOD(Tuba, wr_init, bool(entity thiswep))
+ METHOD(Tuba, wr_init, void(entity thiswep))
{
TUBA_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
- return true;
}
- METHOD(Tuba, wr_setup, bool(entity thiswep))
+ METHOD(Tuba, wr_setup, void(entity thiswep))
{
self.ammo_field = ammo_none;
self.tuba_instrument = 0;
- return true;
}
- METHOD(Tuba, wr_reload, bool(entity thiswep))
+ METHOD(Tuba, wr_reload, void(entity thiswep))
{
+ .entity weaponentity = weaponentities[0]; // TODO: unhardcode
// switch to alternate instruments :)
- if(self.weaponentity.state == WS_READY)
+ if(self.(weaponentity).state == WS_READY)
{
switch(self.tuba_instrument)
{
}
W_SetupShot(self, false, 0, "", 0, 0);
Send_Effect(EFFECT_TELEPORT, w_shotorg, '0 0 0', 1);
- self.weaponentity.state = WS_INUSE;
- weapon_thinkf(WFRAME_RELOAD, 0.5, w_ready);
+ self.(weaponentity).state = WS_INUSE;
+ weapon_thinkf(self, weaponentity, WFRAME_RELOAD, 0.5, w_ready);
}
-
- return true;
}
METHOD(Tuba, wr_checkammo1, bool(entity thiswep))
{
{
return true; // tuba has infinite ammo
}
- METHOD(Tuba, wr_config, bool(entity thiswep))
+ METHOD(Tuba, wr_config, void(entity thiswep))
{
TUBA_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS);
- return true;
}
- METHOD(Tuba, wr_suicidemessage, bool(entity thiswep))
+ METHOD(Tuba, wr_suicidemessage, int(entity thiswep))
{
if(w_deathtype & HITTYPE_BOUNCE)
return WEAPON_KLEINBOTTLE_SUICIDE;
else
return WEAPON_TUBA_SUICIDE;
}
- METHOD(Tuba, wr_killmessage, bool(entity thiswep))
+ METHOD(Tuba, wr_killmessage, int(entity thiswep))
{
if(w_deathtype & HITTYPE_BOUNCE)
return WEAPON_KLEINBOTTLE_MURDER;
return WEAPON_TUBA_MURDER;
}
-#endif
-#ifdef CSQC
-
- METHOD(Tuba, wr_zoomreticle, bool(entity thiswep))
- {
- // no weapon specific image for this weapon
- return false;
- }
-
#endif
#endif