#ifndef VEHICLE_RAPTOR
#define VEHICLE_RAPTOR
#include "raptor.qh"
-#ifndef MENUQC
-int v_raptor(entity, int);
-#endif
-REGISTER_VEHICLE_SIMPLE(
-/* VEH_##id */ RAPTOR,
-/* spawnflags */ VHF_DMGSHAKE | VHF_DMGROLL,
-/* mins,maxs */ '-80 -80 0', '80 80 70',
-/* model */ "models/vehicles/raptor.dpm",
-/* head_model */ "",
-/* hud_model */ "models/vehicles/raptor_cockpit.dpm",
-/* tags */ "", "tag_hud", "tag_camera",
-/* netname */ "raptor",
-/* fullname */ _("Raptor")
-) {
- this.m_icon = "vehicle_raptor";
-#ifndef MENUQC
- this.vehicle_func = v_raptor;
-#endif
-}
+
+CLASS(Raptor, Vehicle)
+/* spawnflags */ ATTRIB(Raptor, spawnflags, int, VHF_DMGSHAKE | VHF_DMGROLL);
+/* mins */ ATTRIB(Raptor, mins, vector, '-80 -80 0');
+/* maxs */ ATTRIB(Raptor, maxs, vector, '80 80 70');
+/* model */ ATTRIB(Raptor, mdl, string, "models/vehicles/raptor.dpm");
+/* model */ ATTRIB(Raptor, model, string, "models/vehicles/raptor.dpm");
+/* head_model */ ATTRIB(Raptor, head_model, string, "");
+/* hud_model */ ATTRIB(Raptor, hud_model, string, "models/vehicles/raptor_cockpit.dpm");
+/* tags */ ATTRIB(Raptor, tag_head, string, "");
+/* tags */ ATTRIB(Raptor, tag_hud, string, "tag_hud");
+/* tags */ ATTRIB(Raptor, tag_hview, string, "tag_camera");
+/* netname */ ATTRIB(Raptor, netname, string, "raptor");
+/* fullname */ ATTRIB(Raptor, vehicle_name, string, _("Raptor"));
+/* icon */ ATTRIB(Raptor, m_icon, string, "vehicle_raptor");
+ENDCLASS(Raptor)
+
+REGISTER_VEHICLE(RAPTOR, NEW(Raptor));
+
#endif
#ifdef IMPLEMENTATION
if(!vehicle_initialize(VEH_RAPTOR, false)) { remove(self); return; }
}
-float v_raptor(Vehicle thisveh, float req)
-{SELFPARAM();
- switch(req)
- {
- case VR_IMPACT:
+ METHOD(Raptor, vr_impact, bool(Raptor thisveh))
{
if(autocvar_g_vehicle_raptor_bouncepain)
vehicles_impact(autocvar_g_vehicle_raptor_bouncepain_x, autocvar_g_vehicle_raptor_bouncepain_y, autocvar_g_vehicle_raptor_bouncepain_z);
return true;
}
- case VR_ENTER:
+ METHOD(Raptor, vr_enter, bool(Raptor thisveh))
{
self.vehicle_weapon2mode = RSM_BOMB;
self.owner.PlayerPhysplug = raptor_takeoff;
CSQCVehicleSetup(self.owner, 0);
return true;
}
- case VR_THINK:
+ METHOD(Raptor, vr_think, bool(Raptor thisveh))
{
return true;
}
- case VR_DEATH:
+ METHOD(Raptor, vr_death, bool(Raptor thisveh))
{
self.health = 0;
self.event_damage = func_null;
self.touch = raptor_blowup;
return true;
}
- case VR_SPAWN:
+ METHOD(Raptor, vr_spawn, bool(Raptor thisveh))
{
if(!self.gun1)
{
self.vehicle_shield = autocvar_g_vehicle_raptor_shield;
return true;
}
- case VR_SETUP:
+ METHOD(Raptor, vr_setup, bool(Raptor thisveh))
{
if(autocvar_g_vehicle_raptor_shield)
self.vehicle_flags |= VHF_HASSHIELD;
return true;
}
- case VR_PRECACHE:
+ METHOD(Raptor, vr_precache, bool(Raptor thisveh))
{
return true;
}
- }
-
- return true;
-}
#endif // SVQC
#ifdef CSQC
sfrag.drawmask = MASK_NORMAL;
}
-float v_raptor(Vehicle thisveh, float req)
-{
- switch(req)
- {
- case VR_HUD:
+ METHOD(Raptor, vr_hud, bool(Raptor thisveh))
{
string crosshair;
crosshair);
return true;
}
- case VR_SETUP:
+ METHOD(Raptor, vr_setup, bool(Raptor thisveh))
{
AuxiliaryXhair[1].axh_image = vCROSS_LOCK;
return true;
}
- case VR_PRECACHE:
+ METHOD(Raptor, vr_precache, bool(Raptor thisveh))
{
return true;
}
- }
-
- return true;
-}
#endif // CSQC
#endif // REGISTER_VEHICLE