#pragma once

#ifdef GAMEQC
MODEL(BLASTER_VIEW, W_Model("h_laser.iqm"));
MODEL(BLASTER_WORLD, W_Model("v_laser.md3"));
MODEL(BLASTER_ITEM, W_Model("g_laser.md3"));

SOUND(BLASTER_FIRE, W_Sound("lasergun_fire"));
#endif

CLASS(Blaster, Weapon)
#ifdef SVQC
/* spawnfunc */ ATTRIB(Blaster, m_canonical_spawnfunc, string, "weapon_blaster");
/* rating    */ ATTRIB(Blaster, bot_pickupbasevalue, float, 0);
#endif
/* ammotype  */ //ATTRIB(Blaster, ammo_type, Resource, RES_NONE);
/* impulse   */ ATTRIB(Blaster, impulse, int, 1);
/* flags     */ ATTRIB(Blaster, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH);
/* color     */ ATTRIB(Blaster, m_color, vector, '0.969 0.443 0.482');
#ifdef GAMEQC
/* modelname */ ATTRIB(Blaster, mdl, string, "laser");
/* model     */ ATTRIB(Blaster, m_model, Model, MDL_BLASTER_ITEM);
/* flash mdl */ ATTRIB(Blaster, m_muzzlemodel, Model, MDL_Null);
/* flash eff */ ATTRIB(Blaster, m_muzzleeffect, entity, EFFECT_BLASTER_MUZZLEFLASH);
#endif
#ifdef CSQC
/* crosshair */ ATTRIB(Blaster, w_crosshair, string, "gfx/crosshairlaser");
/* crosshair */ ATTRIB(Blaster, w_crosshair_size, float, 0.5);
#endif
/* wepimg    */ ATTRIB(Blaster, model2, string, "weaponlaser");
/* refname   */ ATTRIB(Blaster, netname, string, "blaster");
/* wepname   */ ATTRIB(Blaster, m_name, string, _("Blaster"));
/* legacy    */ ATTRIB(Blaster, m_deprecated_netname, string, "laser");

#define X(BEGIN, P, END, class, prefix) \
	BEGIN(class) \
		P(class, prefix, animtime, float, PRI) \
		P(class, prefix, damage, float, PRI) \
		P(class, prefix, delay, float, PRI) \
		P(class, prefix, edgedamage, float, PRI) \
		P(class, prefix, force, float, PRI) \
		P(class, prefix, force_zscale, float, PRI) \
		P(class, prefix, lifetime, float, PRI) \
		P(class, prefix, radius, float, PRI) \
		P(class, prefix, refire, float, PRI) \
		P(class, prefix, shotangle, float, PRI) \
		P(class, prefix, speed, float, PRI) \
		P(class, prefix, spread, float, PRI) \
		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, Blaster, blaster)
#undef X

ENDCLASS(Blaster)
REGISTER_WEAPON(BLASTER, NEW(Blaster));

SPAWNFUNC_WEAPON(weapon_blaster, WEP_BLASTER)
SPAWNFUNC_WEAPON(weapon_laser, WEP_BLASTER) // Nexuiz compat

#ifdef SVQC
CLASS(OffhandBlaster, OffhandWeapon)
ENDCLASS(OffhandBlaster)
OffhandBlaster OFFHAND_BLASTER;
STATIC_INIT(OFFHAND_BLASTER)
{
	OFFHAND_BLASTER = NEW(OffhandBlaster);
}
#endif
