#pragma once

#ifdef GAMEQC
MODEL(DEVASTATOR_MUZZLEFLASH, "models/flash.md3");
MODEL(DEVASTATOR_VIEW, W_Model("h_rl.iqm"));
MODEL(DEVASTATOR_WORLD, W_Model("v_rl.md3"));
MODEL(DEVASTATOR_ITEM, W_Model("g_rl.md3"));

SOUND(DEVASTATOR_DET, W_Sound("rocket_det"));
SOUND(DEVASTATOR_FIRE, W_Sound("rocket_fire"));
SOUND(DEVASTATOR_FLY, W_Sound("rocket_fly"));
SOUND(DEVASTATOR_MODE, W_Sound("rocket_mode"));
#endif

CLASS(Devastator, Weapon)
#ifdef GAMEQC
/* spawnfunc */ ATTRIB(Devastator, m_canonical_spawnfunc, string, "weapon_devastator");
/* rating    */ ATTRIB(Devastator, bot_pickupbasevalue, float, 8000);
#endif
/* ammotype  */ ATTRIB(Devastator, ammo_type, Resource, RES_ROCKETS);
/* impulse   */ ATTRIB(Devastator, impulse, int, 9);
/* flags     */ ATTRIB(Devastator, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH);
/* color     */ ATTRIB(Devastator, m_color, vector, '0.914 0.745 0.341');
#ifdef GAMEQC
/* modelname */ ATTRIB(Devastator, mdl, string, "rl");
/* model     */ ATTRIB(Devastator, m_model, Model, MDL_DEVASTATOR_ITEM);
/* flash mdl */ ATTRIB(Devastator, m_muzzlemodel, Model, MDL_DEVASTATOR_MUZZLEFLASH);
/* flash eff */ ATTRIB(Devastator, m_muzzleeffect, entity, EFFECT_ROCKET_MUZZLEFLASH);
#endif
#ifdef CSQC
/* crosshair */ ATTRIB(Devastator, w_crosshair, string, "gfx/crosshairrocketlauncher");
/* crosshair */ ATTRIB(Devastator, w_crosshair_size, float, 0.7);
#endif
/* wepimg    */ ATTRIB(Devastator, model2, string, "weaponrocketlauncher");
/* refname   */ ATTRIB(Devastator, netname, string, "devastator");
/* wepname   */ ATTRIB(Devastator, m_name, string, _("Devastator"));
/* legacy    */ ATTRIB(Devastator, m_deprecated_netname, string, "rocketlauncher");

#define X(BEGIN, P, END, class, prefix) \
	BEGIN(class) \
		P(class, prefix, ammo, float, NONE) \
		P(class, prefix, animtime, float, NONE) \
		P(class, prefix, damageforcescale, float, NONE) \
		P(class, prefix, damage, float, NONE) \
		P(class, prefix, detonatedelay, float, NONE) \
		P(class, prefix, edgedamage, float, NONE) \
		P(class, prefix, force, float, NONE) \
		P(class, prefix, force_xyscale, float, NONE) \
		P(class, prefix, guidedelay, float, NONE) \
		P(class, prefix, guidegoal, float, NONE) \
		P(class, prefix, guideratedelay, float, NONE) \
		P(class, prefix, guiderate, float, NONE) \
		P(class, prefix, guidestop, float, NONE) \
		P(class, prefix, health, float, NONE) \
		P(class, prefix, lifetime, float, NONE) \
		P(class, prefix, pickup_ammo, float, NONE) \
		P(class, prefix, radius, float, NONE) \
		P(class, prefix, refire, float, NONE) \
		P(class, prefix, reload_ammo, float, NONE) \
		P(class, prefix, reload_time, float, NONE) \
		P(class, prefix, remote_damage, float, NONE) \
		P(class, prefix, remote_edgedamage, float, NONE) \
		P(class, prefix, remote_force, float, NONE) \
		P(class, prefix, remote_jump, float, NONE) \
		P(class, prefix, remote_jump_damage, float, NONE) \
		P(class, prefix, remote_jump_force, float, NONE) \
		P(class, prefix, remote_jump_radius, float, NONE) \
		P(class, prefix, remote_jump_velocity_z_add, float, NONE) \
		P(class, prefix, remote_jump_velocity_z_max, float, NONE) \
		P(class, prefix, remote_jump_velocity_z_min, float, NONE) \
		P(class, prefix, remote_radius, float, NONE) \
		P(class, prefix, speedaccel, float, NONE) \
		P(class, prefix, speedstart, float, NONE) \
		P(class, prefix, speed, 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, Devastator, devastator)
#undef X

ENDCLASS(Devastator)
REGISTER_WEAPON(DEVASTATOR, NEW(Devastator));

SPAWNFUNC_WEAPON(weapon_devastator, WEP_DEVASTATOR)

#ifdef SVQC
.float rl_release;
.float rl_detonate_later;
#endif
