-#ifndef VEHICLE_SPIDERBOT
-#define VEHICLE_SPIDERBOT
-
-#include "spiderbot_weapons.qh"
-
-CLASS(Spiderbot, Vehicle)
-/* spawnflags */ ATTRIB(Spiderbot, spawnflags, int, VHF_DMGSHAKE);
-/* mins */ ATTRIB(Spiderbot, mins, vector, '-75 -75 10');
-/* maxs */ ATTRIB(Spiderbot, maxs, vector, '75 75 125');
-/* view offset*/ ATTRIB(Spiderbot, view_ofs, vector, '0 0 70');
-/* view dist */ ATTRIB(Spiderbot, height, float, 170);
-/* model */ ATTRIB(Spiderbot, mdl, string, "models/vehicles/spiderbot.dpm");
-/* model */ ATTRIB(Spiderbot, model, string, "models/vehicles/spiderbot.dpm");
-/* head_model */ ATTRIB(Spiderbot, head_model, string, "models/vehicles/spiderbot_top.dpm");
-/* hud_model */ ATTRIB(Spiderbot, hud_model, string, "models/vehicles/spiderbot_cockpit.dpm");
-/* tags */ ATTRIB(Spiderbot, tag_head, string, "tag_head");
-/* tags */ ATTRIB(Spiderbot, tag_hud, string, "tag_hud");
-/* tags */ ATTRIB(Spiderbot, tag_view, string, "");
-/* netname */ ATTRIB(Spiderbot, netname, string, "spiderbot");
-/* fullname */ ATTRIB(Spiderbot, vehicle_name, string, _("Spiderbot"));
-/* icon */ ATTRIB(Spiderbot, m_icon, string, "vehicle_spider");
-ENDCLASS(Spiderbot)
-
-REGISTER_VEHICLE(SPIDERBOT, NEW(Spiderbot));
-
-#endif
+#include "spiderbot.qh"
#ifdef IMPLEMENTATION
if(intermission_running)
{
- vehic.velocity = '0 0 0';
- vehic.avelocity = '0 0 0';
+ vehic.solid = SOLID_NOT;
+ vehic.takedamage = DAMAGE_NO;
+ set_movetype(vehic, MOVETYPE_NONE);
return;
}
PHYS_INPUT_BUTTON_ZOOM(this) = false;
PHYS_INPUT_BUTTON_CROUCH(this) = false;
- PS(this).m_switchweapon = WEP_Null;
+ for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ {
+ .entity weaponentity = weaponentities[slot];
+ this.(weaponentity).m_switchweapon = WEP_Null;
+ }
this.vehicle_weapon2mode = vehic.vehicle_weapon2mode;
v_forward = normalize(v_forward);
v += v_forward * 50;
- fireBullet(this, v, v_forward, autocvar_g_vehicle_spiderbot_minigun_spread, autocvar_g_vehicle_spiderbot_minigun_solidpenetration,
+ .entity weaponentity = weaponentities[0]; // TODO: unhardcode
+ fireBullet(this, weaponentity, v, v_forward, autocvar_g_vehicle_spiderbot_minigun_spread, autocvar_g_vehicle_spiderbot_minigun_solidpenetration,
autocvar_g_vehicle_spiderbot_minigun_damage, autocvar_g_vehicle_spiderbot_minigun_force, DEATH_VH_SPID_MINIGUN.m_id, 0);
sound (gun, CH_WEAPON_A, SND_UZI_FIRE, VOL_BASE, ATTEN_NORM);
{
vector spot;
- FOREACH_ENTITY_ENT(owner, this.owner,
+ IL_EACH(g_projectiles, it.owner == this.owner && it.classname == "spiderbot_rocket",
{
- if(it.classname != "spiderbot_rocket") continue;
it.realowner = this.owner;
it.owner = NULL;
});