]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/vehicles/vehicle/bumblebee.qc
Reduce name space of resource constants and variables (RESOURCE_* --> RES_*, resour...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / vehicles / vehicle / bumblebee.qc
index d0bbdeddf95666c0bbd7fcc785bc64a190f367f3..55574eb8299a80d0167c69ce07052f89e933f0d0 100644 (file)
@@ -168,7 +168,7 @@ bool bumblebee_gunner_frame(entity this, float dt)
                                gun.attack_finished_single[0] = time + autocvar_g_vehicle_bumblebee_cannon_refire;
                        }
 
-       VEHICLE_UPDATE_PLAYER_RESOURCE(this, vehic, health, bumblebee, RESOURCE_HEALTH);
+       VEHICLE_UPDATE_PLAYER_RESOURCE(this, vehic, health, bumblebee, RES_HEALTH);
 
        if(vehic.vehicle_flags & VHF_HASSHIELD)
                VEHICLE_UPDATE_PLAYER(this, vehic, shield, bumblebee);
@@ -397,7 +397,7 @@ void bumblebee_regen(entity this, float dt)
                vehicles_regen(this, this.dmg_time, vehicle_shield, autocvar_g_vehicle_bumblebee_shield, autocvar_g_vehicle_bumblebee_shield_regen_pause, autocvar_g_vehicle_bumblebee_shield_regen, dt, true);
 
        if(this.vehicle_flags  & VHF_HEALTHREGEN)
-               vehicles_regen_resource(this, this.dmg_time, vehicle_health, autocvar_g_vehicle_bumblebee_health, autocvar_g_vehicle_bumblebee_health_regen_pause, autocvar_g_vehicle_bumblebee_health_regen, dt, false, RESOURCE_HEALTH);
+               vehicles_regen_resource(this, this.dmg_time, vehicle_health, autocvar_g_vehicle_bumblebee_health, autocvar_g_vehicle_bumblebee_health_regen_pause, autocvar_g_vehicle_bumblebee_health_regen, dt, false, RES_HEALTH);
 
        if(this.vehicle_flags  & VHF_ENERGYREGEN)
                vehicles_regen(this, this.wait, vehicle_energy, autocvar_g_vehicle_bumblebee_energy, autocvar_g_vehicle_bumblebee_energy_regen_pause, autocvar_g_vehicle_bumblebee_energy_regen, dt, false);
@@ -557,19 +557,19 @@ bool bumblebee_pilot_frame(entity this, float dt)
                                        {
                                                if(autocvar_g_vehicle_bumblebee_healgun_hps)
                                                {
-                                                       float hplimit = ((IS_PLAYER(trace_ent)) ? autocvar_g_vehicle_bumblebee_healgun_hmax : RESOURCE_LIMIT_NONE);
+                                                       float hplimit = ((IS_PLAYER(trace_ent)) ? autocvar_g_vehicle_bumblebee_healgun_hmax : RES_LIMIT_NONE);
                                                        Heal(trace_ent, this, autocvar_g_vehicle_bumblebee_healgun_hps * dt, hplimit);
                                                }
 
                                                if(IS_VEHICLE(trace_ent))
                                                {
-                                                       if(autocvar_g_vehicle_bumblebee_healgun_sps && GetResourceAmount(trace_ent, RESOURCE_HEALTH) <= trace_ent.max_health)
+                                                       if(autocvar_g_vehicle_bumblebee_healgun_sps && GetResourceAmount(trace_ent, RES_HEALTH) <= trace_ent.max_health)
                                                                trace_ent.vehicle_shield = min(trace_ent.vehicle_shield + autocvar_g_vehicle_bumblebee_healgun_sps * dt, trace_ent.tur_head.max_health);
                                                }
                                                else if(IS_CLIENT(trace_ent))
                                                {
-                                                       if(GetResourceAmount(trace_ent, RESOURCE_ARMOR) <= autocvar_g_vehicle_bumblebee_healgun_amax && autocvar_g_vehicle_bumblebee_healgun_aps)
-                                                               GiveResourceWithLimit(trace_ent, RESOURCE_ARMOR, autocvar_g_vehicle_bumblebee_healgun_aps * dt, autocvar_g_vehicle_bumblebee_healgun_amax);
+                                                       if(GetResourceAmount(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);
                                                }
                                        }
                                }
@@ -592,7 +592,7 @@ bool bumblebee_pilot_frame(entity this, float dt)
        }
        */
 
-       VEHICLE_UPDATE_PLAYER_RESOURCE(this, vehic, health, bumblebee, RESOURCE_HEALTH);
+       VEHICLE_UPDATE_PLAYER_RESOURCE(this, vehic, health, bumblebee, RES_HEALTH);
        VEHICLE_UPDATE_PLAYER(this, vehic, energy, bumblebee);
 
        this.vehicle_ammo1 = (vehic.gun1.vehicle_energy / autocvar_g_vehicle_bumblebee_cannon_ammo) * 100;
@@ -802,7 +802,7 @@ METHOD(Bumblebee, vr_death, void(Bumblebee thisveh, entity instance))
 
     Send_Effect(EFFECT_EXPLOSION_MEDIUM, findbetterlocation(instance.origin, 16), '0 0 0', 1);
 
-    SetResourceAmount(instance, RESOURCE_HEALTH, 0);
+    SetResourceAmount(instance, RES_HEALTH, 0);
     instance.event_damage      = func_null;
     instance.solid                     = SOLID_NOT;
     instance.takedamage                = DAMAGE_NO;
@@ -887,7 +887,7 @@ METHOD(Bumblebee, vr_spawn, void(Bumblebee thisveh, entity instance))
     if(!autocvar_g_vehicle_bumblebee_swim)
        instance.dphitcontentsmask |= DPCONTENTS_LIQUIDSMASK;
 
-    SetResourceAmount(instance, RESOURCE_HEALTH, autocvar_g_vehicle_bumblebee_health);
+    SetResourceAmount(instance, RES_HEALTH, autocvar_g_vehicle_bumblebee_health);
     instance.vehicle_shield = autocvar_g_vehicle_bumblebee_shield;
     instance.solid = SOLID_BBOX;
     set_movetype(instance, MOVETYPE_TOSS);
@@ -914,8 +914,8 @@ METHOD(Bumblebee, vr_setup, void(Bumblebee thisveh, entity instance))
 
     instance.vehicle_exit = bumblebee_exit;
     instance.respawntime = autocvar_g_vehicle_bumblebee_respawntime;
-    SetResourceAmount(instance, RESOURCE_HEALTH, autocvar_g_vehicle_bumblebee_health);
-    instance.max_health = GetResourceAmount(instance, RESOURCE_HEALTH);
+    SetResourceAmount(instance, RES_HEALTH, autocvar_g_vehicle_bumblebee_health);
+    instance.max_health = GetResourceAmount(instance, RES_HEALTH);
     instance.vehicle_shield = autocvar_g_vehicle_bumblebee_shield;
 }