]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/vehicles/vehicle/spiderbot.qc
Merge branch 'master' into terencehill/dynamic_hud
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / vehicles / vehicle / spiderbot.qc
index fa2f6f9ccafd1837b4406332a271999bf5f49ff4..57f1310c4b8cf618f21b8f12b2f2ba39aa13e7a4 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef VEHICLE_SPIDERBOT
 #define VEHICLE_SPIDERBOT
 
-#include "spiderbot_weapons.qc"
+#include "spiderbot_weapons.qh"
 
 CLASS(Spiderbot, Vehicle)
 /* spawnflags */ ATTRIB(Spiderbot, spawnflags, int, VHF_DMGSHAKE);
@@ -33,8 +33,6 @@ const int SBRM_GUIDE = 2;
 const int SBRM_ARTILLERY = 3;
 const int SBRM_LAST = 3;
 
-#include "spiderbot_weapons.qc"
-
 #ifdef SVQC
 bool autocvar_g_vehicle_spiderbot = true;
 
@@ -77,8 +75,8 @@ bool spiderbot_frame(entity this)
 
        if(intermission_running)
        {
-               self.vehicle.velocity = '0 0 0';
-               self.vehicle.avelocity = '0 0 0';
+               vehic.velocity = '0 0 0';
+               vehic.avelocity = '0 0 0';
                return;
        }
 
@@ -130,7 +128,7 @@ bool spiderbot_frame(entity this)
        //fixedmakevectors(vehic.angles);
        makevectors(vehic.angles + '-2 0 0' * vehic.angles_x);
 
-       WITH(entity, self, vehic, movelib_groundalign4point(autocvar_g_vehicle_spiderbot_springlength, autocvar_g_vehicle_spiderbot_springup, autocvar_g_vehicle_spiderbot_springblend, autocvar_g_vehicle_spiderbot_tiltlimit));
+       movelib_groundalign4point(vehic, autocvar_g_vehicle_spiderbot_springlength, autocvar_g_vehicle_spiderbot_springup, autocvar_g_vehicle_spiderbot_springblend, autocvar_g_vehicle_spiderbot_tiltlimit);
 
        if(IS_ONGROUND(vehic))
                vehic.jump_delay = time; // reset now so movement can begin
@@ -286,8 +284,8 @@ bool spiderbot_frame(entity this)
                        v_forward = normalize(v_forward);
                        v += v_forward * 50;
 
-                       WITH(entity, self, this, fireBullet(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));
+                       fireBullet(this, 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);
                        //trailparticles(self, _particleeffectnum("spiderbot_minigun_trail"), v, trace_endpos);
@@ -311,7 +309,7 @@ bool spiderbot_frame(entity this)
                                                                                   autocvar_g_vehicle_spiderbot_minigun_ammo_regen, frametime, false);
 
 
-       WITH(entity, self, vehic, spiderbot_rocket_do());
+       spiderbot_rocket_do(vehic);
 
        if(vehic.vehicle_flags  & VHF_SHIELDREGEN)
                vehicles_regen(vehic, vehic.dmg_time, vehicle_shield, autocvar_g_vehicle_spiderbot_shield, autocvar_g_vehicle_spiderbot_shield_regen_pause, autocvar_g_vehicle_spiderbot_shield_regen, frametime, true);
@@ -538,14 +536,14 @@ bool spiderbot_impulse(int _imp)
 
 spawnfunc(vehicle_spiderbot)
 {
-       if(!autocvar_g_vehicle_spiderbot) { remove(self); return; }
-       if(!vehicle_initialize(VEH_SPIDERBOT, false)) { remove(self); return; }
+       if(!autocvar_g_vehicle_spiderbot) { remove(this); return; }
+       if(!vehicle_initialize(this, VEH_SPIDERBOT, false)) { remove(this); return; }
 }
 
 METHOD(Spiderbot, vr_impact, void(Spiderbot thisveh, entity instance))
 {
     if(autocvar_g_vehicle_spiderbot_bouncepain)
-        vehicles_impact(autocvar_g_vehicle_spiderbot_bouncepain_x, autocvar_g_vehicle_spiderbot_bouncepain_y, autocvar_g_vehicle_spiderbot_bouncepain_z);
+        vehicles_impact(instance, autocvar_g_vehicle_spiderbot_bouncepain_x, autocvar_g_vehicle_spiderbot_bouncepain_y, autocvar_g_vehicle_spiderbot_bouncepain_z);
 }
 METHOD(Spiderbot, vr_enter, void(Spiderbot thisveh, entity instance))
 {
@@ -620,21 +618,20 @@ METHOD(Spiderbot, vr_spawn, void(Spiderbot thisveh, entity instance))
 }
 METHOD(Spiderbot, vr_setup, void(Spiderbot thisveh, entity instance))
 {
-    SELFPARAM();
     if(autocvar_g_vehicle_spiderbot_shield)
-        self.vehicle_flags |= VHF_HASSHIELD;
+        instance.vehicle_flags |= VHF_HASSHIELD;
 
     if(autocvar_g_vehicle_spiderbot_shield_regen)
-        self.vehicle_flags |= VHF_SHIELDREGEN;
+        instance.vehicle_flags |= VHF_SHIELDREGEN;
 
     if(autocvar_g_vehicle_spiderbot_health_regen)
-        self.vehicle_flags |= VHF_HEALTHREGEN;
+        instance.vehicle_flags |= VHF_HEALTHREGEN;
 
-    self.respawntime = autocvar_g_vehicle_spiderbot_respawntime;
-    self.vehicle_health = autocvar_g_vehicle_spiderbot_health;
-    self.vehicle_shield = autocvar_g_vehicle_spiderbot_shield;
-    self.max_health = self.vehicle_health;
-    self.pushable = true; // spiderbot can use jumppads
+    instance.respawntime = autocvar_g_vehicle_spiderbot_respawntime;
+    instance.vehicle_health = autocvar_g_vehicle_spiderbot_health;
+    instance.vehicle_shield = autocvar_g_vehicle_spiderbot_shield;
+    instance.max_health = instance.vehicle_health;
+    instance.pushable = true; // spiderbot can use jumppads
 }
 
 #endif // SVQC