]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/vehicles/vehicle/bumblebee.qc
Tidy up classnames
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / vehicles / vehicle / bumblebee.qc
index a83b0928f347851f7fb1b9b11921d2ad02b92306..8b34473e398a5894256e386200459a00eec45ada 100644 (file)
@@ -1,5 +1,11 @@
 #include "bumblebee.qh"
 
+#ifdef GAMEQC
+
+#ifdef SVQC
+       #include <common/mutators/mutator/instagib/sv_instagib.qh>
+#endif
+
 const float BRG_SETUP = 2;
 const float BRG_START = 4;
 const float BRG_END = 8;
@@ -157,7 +163,7 @@ bool bumblebee_gunner_frame(entity this, float dt)
                                                  autocvar_g_vehicle_bumblebee_cannon_pitchlimit_down * -1, autocvar_g_vehicle_bumblebee_cannon_pitchlimit_up,
                                                  _out * -1,  _in,  autocvar_g_vehicle_bumblebee_cannon_turnspeed, dt);
 
-       if(!forbidWeaponUse(this))
+       if(!weaponLocked(this) && !weaponUseForbidden(this))
        if(PHYS_INPUT_BUTTON_ATCK(this))
                if(time > gun.attack_finished_single[0])
                        if(gun.vehicle_energy >= autocvar_g_vehicle_bumblebee_cannon_cost)
@@ -224,6 +230,7 @@ void bumblebee_gunner_exit(entity this, int _exitflag)
                WriteByte(MSG_ONE, SVC_SETVIEWPORT);
                WriteEntity(MSG_ONE, player);
 
+               // NOTE: engine networked
                WriteByte(MSG_ONE, SVC_SETVIEWANGLES);
                WriteAngle(MSG_ONE, 0);
                WriteAngle(MSG_ONE, vehic.angles.y);
@@ -334,6 +341,7 @@ bool bumblebee_gunner_enter(entity this, entity player)
                WriteByte(MSG_ONE,              SVC_SETVIEWPORT);
                WriteEntity(MSG_ONE,    gunner.vehicle_viewport);
 
+               // NOTE: engine networked
                WriteByte(MSG_ONE,              SVC_SETVIEWANGLES);
                WriteAngle(MSG_ONE,     gunner.angles_x + vehic.angles_x); // tilt
                WriteAngle(MSG_ONE,     gunner.angles_y + vehic.angles_y); // yaw
@@ -531,7 +539,7 @@ bool bumblebee_pilot_frame(entity this, float dt)
                                          autocvar_g_vehicle_bumblebee_raygun_pitchlimit_down * -1,  autocvar_g_vehicle_bumblebee_raygun_pitchlimit_up,
                                          autocvar_g_vehicle_bumblebee_raygun_turnlimit_sides * -1,  autocvar_g_vehicle_bumblebee_raygun_turnlimit_sides,  autocvar_g_vehicle_bumblebee_raygun_turnspeed, dt);
 
-       if(!forbidWeaponUse(this))
+       if(!weaponLocked(this) && !weaponUseForbidden(this))
        if((PHYS_INPUT_BUTTON_ATCK(this) || PHYS_INPUT_BUTTON_ATCK2(this)) && (vehic.vehicle_energy > autocvar_g_vehicle_bumblebee_raygun_dps * PHYS_INPUT_FRAMETIME || autocvar_g_vehicle_bumblebee_raygun == 0))
        {
                vehic.gun3.enemy.realowner = this;
@@ -568,8 +576,9 @@ bool bumblebee_pilot_frame(entity this, float dt)
                                                }
                                                else if(IS_CLIENT(trace_ent))
                                                {
-                                                       if(GetResource(trace_ent, RES_ARMOR) <= autocvar_g_vehicle_bumblebee_healgun_amax && autocvar_g_vehicle_bumblebee_healgun_aps)
-                                                               GiveResourceWithLimit(trace_ent, RES_ARMOR, autocvar_g_vehicle_bumblebee_healgun_aps * dt, autocvar_g_vehicle_bumblebee_healgun_amax);
+                                                       float maxarmor = ((MUTATOR_IS_ENABLED(mutator_instagib)) ? autocvar_g_instagib_extralives : autocvar_g_vehicle_bumblebee_healgun_amax);
+                                                       if(GetResource(trace_ent, RES_ARMOR) <= maxarmor && autocvar_g_vehicle_bumblebee_healgun_aps)
+                                                               GiveResourceWithLimit(trace_ent, RES_ARMOR, autocvar_g_vehicle_bumblebee_healgun_aps * dt, maxarmor);
                                                }
                                        }
                                }
@@ -822,7 +831,7 @@ METHOD(Bumblebee, vr_spawn, void(Bumblebee thisveh, entity instance))
     if(!instance.gun1)
     {
         // for some reason, autosizing of the shield entity refuses to work for this one so set it up in advance.
-        instance.vehicle_shieldent = spawn();
+        instance.vehicle_shieldent = new(vehicle_shieldent);
         instance.vehicle_shieldent.effects = EF_LOWPRECISION;
         setmodel(instance.vehicle_shieldent, MDL_VEH_BUMBLEBEE_SHIELD);
         setattachment(instance.vehicle_shieldent, instance, "");
@@ -876,7 +885,7 @@ METHOD(Bumblebee, vr_spawn, void(Bumblebee thisveh, entity instance))
         // Raygun beam
         if(instance.gun3.enemy == NULL)
         {
-            instance.gun3.enemy = spawn();
+            instance.gun3.enemy = new(bumble_raygun);
             Net_LinkEntity(instance.gun3.enemy, true, 0, bumble_raygun_send);
             instance.gun3.enemy.SendFlags = BRG_SETUP;
             instance.gun3.enemy.cnt = autocvar_g_vehicle_bumblebee_raygun;
@@ -965,3 +974,5 @@ METHOD(Bumblebee, vr_setup, void(Bumblebee thisveh, entity instance))
 }
 
 #endif
+
+#endif