#pragma once

#ifdef GAMEQC
MODEL(FIREBALL_SPHERE, "models/sphere/sphere.md3");
MODEL(FIREBALL_VIEW, W_Model("h_fireball.iqm"));
MODEL(FIREBALL_WORLD, W_Model("v_fireball.md3"));
MODEL(FIREBALL_ITEM, W_Model("g_fireball.md3"));

SOUND(FIREBALL_FIRE2, W_Sound("fireball_fire2"));
SOUND(FIREBALL_FIRE, W_Sound("fireball_fire"));
SOUND(FIREBALL_FLY2, W_Sound("fireball_fly2"));
SOUND(FIREBALL_FLY, W_Sound("fireball_fly"));
SOUND(FIREBALL_IMPACT2, W_Sound("fireball_impact2"));
SOUND(FIREBALL_PREFIRE2, W_Sound("fireball_prefire2"));
#endif

CLASS(Fireball, Weapon)
#ifdef SVQC
/* spawnfunc */ ATTRIB(Fireball, m_canonical_spawnfunc, string, "weapon_fireball");
/* rating    */ ATTRIB(Fireball, bot_pickupbasevalue, float, 5000);
#endif
/* ammotype  */ //ATTRIB(Fireball, ammo_type, Resource, RES_NONE);
/* impulse   */ ATTRIB(Fireball, impulse, int, 9);
/* flags     */ ATTRIB(Fireball, spawnflags, int, WEP_FLAG_SUPERWEAPON | WEP_TYPE_SPLASH | WEP_FLAG_NODUAL);
/* color     */ ATTRIB(Fireball, m_color, vector, '0.941 0.522 0.373');
#ifdef GAMEQC
/* modelname */ ATTRIB(Fireball, mdl, string, "fireball");
/* model     */ ATTRIB(Fireball, m_model, Model, MDL_FIREBALL_ITEM);
/* flash mdl */ ATTRIB(Fireball, m_muzzlemodel, Model, MDL_Null);
/* flash eff */ ATTRIB(Fireball, m_muzzleeffect, entity, EFFECT_FIREBALL_MUZZLEFLASH);
#endif
#ifdef CSQC
/* crosshair */ ATTRIB(Fireball, w_crosshair, string, "gfx/crosshairfireball");
/* crosshair */ //ATTRIB(Fireball, w_crosshair_size, float, 0.65);
#endif
/* wepimg    */ ATTRIB(Fireball, model2, string, "weaponfireball");
/* refname   */ ATTRIB(Fireball, netname, string, "fireball");
/* wepname   */ ATTRIB(Fireball, m_name, string, _("Fireball"));

#define X(BEGIN, P, END, class, prefix) \
	BEGIN(class) \
		P(class, prefix, animtime, float, BOTH) \
		P(class, prefix, bfgdamage, float, PRI) \
		P(class, prefix, bfgforce, float, PRI) \
		P(class, prefix, bfgradius, float, PRI) \
		P(class, prefix, damageforcescale, float, BOTH) \
		P(class, prefix, damagetime, float, SEC) \
		P(class, prefix, damage, float, BOTH) \
		P(class, prefix, edgedamage, float, PRI) \
		P(class, prefix, force, float, PRI) \
		P(class, prefix, health, float, PRI) \
		P(class, prefix, laserburntime, float, BOTH) \
		P(class, prefix, laserdamage, float, BOTH) \
		P(class, prefix, laseredgedamage, float, BOTH) \
		P(class, prefix, laserradius, float, BOTH) \
		P(class, prefix, lifetime, float, BOTH) \
		P(class, prefix, radius, float, PRI) \
		P(class, prefix, refire2, float, PRI) \
		P(class, prefix, refire, float, BOTH) \
		P(class, prefix, speed, float, BOTH) \
		P(class, prefix, speed_up, float, SEC) \
		P(class, prefix, speed_z, float, SEC) \
		P(class, prefix, spread, float, BOTH) \
		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, Fireball, fireball)
#undef X

ENDCLASS(Fireball)
REGISTER_WEAPON(FIREBALL, NEW(Fireball));

SPAWNFUNC_WEAPON(weapon_fireball, WEP_FIREBALL)

#ifdef SVQC
.vector fireball_impactvec;
.float fireball_primarytime;
#endif
