#pragma once

#ifdef GAMEQC
MODEL(TUBA_VIEW, W_Model("h_tuba.iqm"));
MODEL(TUBA_WORLD, W_Model("v_tuba.md3"));
MODEL(TUBA_ITEM, W_Model("g_tuba.md3"));
MODEL(ACCORDION_VIEW, W_Model("h_akordeon.iqm"));
MODEL(ACCORDION_WORLD, W_Model("v_akordeon.md3"));
MODEL(KLEINBOTTLE_VIEW, W_Model("h_kleinbottle.iqm"));
MODEL(KLEINBOTTLE_WORLD, W_Model("v_kleinbottle.md3"));
#endif

#ifdef CSQC
float autocvar_cl_tuba_attenuation = 0.5;
float autocvar_cl_tuba_fadetime = 0.25;
float autocvar_cl_tuba_pitchstep = 6;
float autocvar_cl_tuba_volume = 1;
#endif

CLASS(Tuba, Weapon)
#ifdef SVQC
/* spawnfunc */ ATTRIB(Tuba, m_canonical_spawnfunc, string, "weapon_tuba");
/* rating    */ ATTRIB(Tuba, bot_pickupbasevalue, float, 2000);
#endif
/* impulse   */ ATTRIB(Tuba, impulse, int, 1);
/* flags     */ ATTRIB(Tuba, spawnflags, int, WEP_FLAG_HIDDEN | WEP_TYPE_SPLASH | WEP_FLAG_NODUAL | WEP_FLAG_NOTRUEAIM);
/* color     */ ATTRIB(Tuba, m_color, vector, '0.909 0.816 0.345');
#ifdef GAMEQC
/* modelname */ ATTRIB(Tuba, mdl, string, "tuba");
/* model     */ ATTRIB(Tuba, m_model, Model, MDL_TUBA_ITEM);
#endif
#ifdef CSQC
/* crosshair */ ATTRIB(Tuba, w_crosshair, string, "gfx/crosshairtuba");
/* crosshair */ //ATTRIB(Tuba, w_crosshair_size, float, 0.65);
#endif
/* wepimg    */ ATTRIB(Tuba, model2, string, "weapontuba");
/* refname   */ ATTRIB(Tuba, netname, string, "tuba");
/* xgettext:no-c-format */
/* wepname   */ ATTRIB(Tuba, m_name, string, _("@!#%'n Tuba"));

#define X(BEGIN, P, END, class, prefix) \
	BEGIN(class) \
		P(class, prefix, animtime, float, NONE) \
		P(class, prefix, attenuation, float, NONE) \
		P(class, prefix, damage, float, NONE) \
		P(class, prefix, edgedamage, float, NONE) \
		P(class, prefix, force, float, NONE) \
		P(class, prefix, radius, float, NONE) \
		P(class, prefix, refire, float, NONE) \
		P(class, prefix, switchdelay_drop, float, NONE) \
		P(class, prefix, switchdelay_raise, float, NONE) \
		P(class, prefix, weaponreplace, string, NONE) \
		P(class, prefix, weaponstartoverride, float, NONE) \
		P(class, prefix, weaponstart, float, NONE) \
		P(class, prefix, weaponthrowable, float, NONE) \
	END()
	W_PROPS(X, Tuba, tuba)
#undef X

ENDCLASS(Tuba)
REGISTER_WEAPON(TUBA, NEW(Tuba));

SPAWNFUNC_WEAPON(weapon_tuba, WEP_TUBA)

#ifdef CSQC
entityclass(Tuba);
classfield(Tuba) .int note;
classfield(Tuba) .bool tuba_attenuate;
classfield(Tuba) .float tuba_volume;
classfield(Tuba) .float tuba_volume_initial;
classfield(Tuba) .int tuba_instrument;
#endif

#ifdef SVQC
float autocvar_snd_soundradius;

bool W_Tuba_HasPlayed(entity pl, .entity weaponentity, string melody, int instrument, bool ignorepitch, float mintempo, float maxtempo);
#endif
