#pragma once

#ifdef GAMEQC
MODEL(ELECTRO_VIEW, W_Model("h_electro.iqm"));
MODEL(ELECTRO_WORLD, W_Model("v_electro.md3"));
MODEL(ELECTRO_ITEM, W_Model("g_electro.md3"));

SOUND(ELECTRO_BOUNCE, W_Sound("electro_bounce"));
SOUND(ELECTRO_FIRE2, W_Sound("electro_fire2"));
SOUND(ELECTRO_FIRE, W_Sound("electro_fire"));
SOUND(ELECTRO_FLY, W_Sound("electro_fly"));
SOUND(ELECTRO_IMPACT, W_Sound("electro_impact"));
SOUND(ELECTRO_IMPACT_COMBO, W_Sound("electro_impact_combo"));
#endif

CLASS(Electro, Weapon)
#ifdef GAMEQC
/* spawnfunc */ ATTRIB(Electro, m_canonical_spawnfunc, string, "weapon_electro");
/* rating    */ ATTRIB(Electro, bot_pickupbasevalue, float, 5000);
#endif
/* ammotype  */ ATTRIB(Electro, ammo_type, Resource, RES_CELLS);
/* impulse   */ ATTRIB(Electro, impulse, int, 5);
/* flags     */ ATTRIB(Electro, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH);
/* color     */ ATTRIB(Electro, m_color, vector, '0.408 0.600 0.949');
#ifdef GAMEQC
/* modelname */ ATTRIB(Electro, mdl, string, "electro");
/* model     */ ATTRIB(Electro, m_model, Model, MDL_ELECTRO_ITEM);
/* flash mdl */ ATTRIB(Electro, m_muzzlemodel, Model, MDL_Null);
/* flash eff */ ATTRIB(Electro, m_muzzleeffect, entity, EFFECT_ELECTRO_MUZZLEFLASH);
#endif
#ifdef CSQC
/* crosshair */ ATTRIB(Electro, w_crosshair, string, "gfx/crosshairelectro");
/* crosshair */ ATTRIB(Electro, w_crosshair_size, float, 0.6);
#endif
/* wepimg    */ ATTRIB(Electro, model2, string, "weaponelectro");
/* refname   */ ATTRIB(Electro, netname, string, "electro");
/* wepname   */ ATTRIB(Electro, m_name, string, _("Electro"));

#define X(BEGIN, P, END, class, prefix) \
	BEGIN(class) \
		P(class, prefix, ammo, float, BOTH) \
		P(class, prefix, animtime, float, BOTH) \
		P(class, prefix, bouncefactor, float, SEC) \
		P(class, prefix, bouncestop, float, SEC) \
		P(class, prefix, comboradius, float, PRI) \
		P(class, prefix, combo_comboradius, float, NONE) \
		P(class, prefix, combo_comboradius_thruwall, float, NONE) \
		P(class, prefix, combo_damage, float, NONE) \
		P(class, prefix, combo_duration, float, NONE) \
		P(class, prefix, combo_edgedamage, float, NONE) \
		P(class, prefix, combo_force, float, NONE) \
		P(class, prefix, combo_radius, float, NONE) \
		P(class, prefix, combo_safeammocheck, float, NONE) \
		P(class, prefix, combo_speed, float, NONE) \
		P(class, prefix, count, float, SEC) \
		P(class, prefix, damagedbycontents, float, SEC) \
		P(class, prefix, damageforcescale, float, SEC) \
		P(class, prefix, damage, float, BOTH) \
		P(class, prefix, edgedamage, float, BOTH) \
		P(class, prefix, force, float, BOTH) \
		P(class, prefix, health, float, SEC) \
		P(class, prefix, lifetime, float, BOTH) \
		P(class, prefix, limit, float, SEC) \
		P(class, prefix, midaircombo_enemy, bool, PRI) \
		P(class, prefix, midaircombo_explode, float, PRI) \
		P(class, prefix, midaircombo_interval, float, PRI) \
		P(class, prefix, midaircombo_own, bool, PRI) \
		P(class, prefix, midaircombo_radius, float, PRI) \
		P(class, prefix, midaircombo_speed, float, PRI) \
		P(class, prefix, midaircombo_teammate, float, PRI) \
		P(class, prefix, pickup_ammo, float, NONE) \
		P(class, prefix, radius, float, BOTH) \
		P(class, prefix, refire2, float, SEC) \
		P(class, prefix, refire, float, BOTH) \
		P(class, prefix, reload_ammo, float, NONE) \
		P(class, prefix, reload_time, float, NONE) \
		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, stick, float, SEC) \
		P(class, prefix, stick_lifetime, float, SEC) \
		P(class, prefix, switchdelay_drop, float, NONE) \
		P(class, prefix, switchdelay_raise, float, NONE) \
		P(class, prefix, touchexplode, float, SEC) \
		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, Electro, electro)
#undef X

ENDCLASS(Electro)
REGISTER_WEAPON(ELECTRO, NEW(Electro));

SPAWNFUNC_WEAPON(weapon_electro, WEP_ELECTRO)

#ifdef SVQC
IntrusiveList LimitedElectroBallRubbleList;
.float electro_count;
.float electro_secondarytime;
void W_Electro_ExplodeCombo(entity this);
#endif
