X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fvehicles%2Fvehicle%2Fraptor.qc;h=6e91441685d49cde764aec948312a38365aa172e;hb=0ca59fa70f5e81336415e1661d879aa91ff03db0;hp=0150ee98f930fe673f2897d0592540c87981ff3e;hpb=8e5d376c49510049572c7c182ba8778c8a8f80dd;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/vehicles/vehicle/raptor.qc b/qcsrc/common/vehicles/vehicle/raptor.qc index 0150ee98f..6e9144168 100644 --- a/qcsrc/common/vehicles/vehicle/raptor.qc +++ b/qcsrc/common/vehicles/vehicle/raptor.qc @@ -358,7 +358,7 @@ bool raptor_frame(entity this, float dt) Weapon wep1 = WEP_RAPTOR; .entity weaponentity = weaponentities[0]; - if(!forbidWeaponUse(this)) + if(!weaponLocked(this)) if(PHYS_INPUT_BUTTON_ATCK(this)) if (wep1.wr_checkammo1(wep1, vehic, weaponentity)) { @@ -369,13 +369,13 @@ bool raptor_frame(entity this, float dt) vehicles_regen(vehic, vehic.dmg_time, vehicle_shield, autocvar_g_vehicle_raptor_shield, autocvar_g_vehicle_raptor_shield_regen_pause, autocvar_g_vehicle_raptor_shield_regen, dt, true); if(vehic.vehicle_flags & VHF_HEALTHREGEN) - vehicles_regen_resource(vehic, vehic.dmg_time, vehicle_health, autocvar_g_vehicle_raptor_health, autocvar_g_vehicle_raptor_health_regen_pause, autocvar_g_vehicle_raptor_health_regen, dt, false, RESOURCE_HEALTH); + vehicles_regen_resource(vehic, vehic.dmg_time, vehicle_health, autocvar_g_vehicle_raptor_health, autocvar_g_vehicle_raptor_health_regen_pause, autocvar_g_vehicle_raptor_health_regen, dt, false, RES_HEALTH); if(vehic.vehicle_flags & VHF_ENERGYREGEN) vehicles_regen(vehic, vehic.cnt, vehicle_energy, autocvar_g_vehicle_raptor_energy, autocvar_g_vehicle_raptor_energy_regen_pause, autocvar_g_vehicle_raptor_energy_regen, dt, false); Weapon wep2a = WEP_RAPTOR_BOMB; - if(!forbidWeaponUse(this)) + if(!weaponLocked(this)) if(STAT(VEHICLESTAT_W2MODE, vehic) == RSM_BOMB) { if(time > vehic.lip + autocvar_g_vehicle_raptor_bombs_refire) @@ -427,7 +427,7 @@ bool raptor_frame(entity this, float dt) } - VEHICLE_UPDATE_PLAYER_RESOURCE(this, vehic, health, raptor, RESOURCE_HEALTH); + VEHICLE_UPDATE_PLAYER_RESOURCE(this, vehic, health, raptor, RES_HEALTH); VEHICLE_UPDATE_PLAYER(this, vehic, energy, raptor); if(vehic.vehicle_flags & VHF_HASSHIELD) VEHICLE_UPDATE_PLAYER(this, vehic, shield, raptor); @@ -471,7 +471,7 @@ bool raptor_takeoff(entity this, float dt) vehicles_regen(vehic, vehic.dmg_time, vehicle_shield, autocvar_g_vehicle_raptor_shield, autocvar_g_vehicle_raptor_shield_regen_pause, autocvar_g_vehicle_raptor_shield_regen, dt, true); if(vehic.vehicle_flags & VHF_HEALTHREGEN) - vehicles_regen_resource(vehic, vehic.dmg_time, vehicle_health, autocvar_g_vehicle_raptor_health, autocvar_g_vehicle_raptor_health_regen_pause, autocvar_g_vehicle_raptor_health_regen, dt, false, RESOURCE_HEALTH); + vehicles_regen_resource(vehic, vehic.dmg_time, vehicle_health, autocvar_g_vehicle_raptor_health, autocvar_g_vehicle_raptor_health_regen_pause, autocvar_g_vehicle_raptor_health_regen, dt, false, RES_HEALTH); if(vehic.vehicle_flags & VHF_ENERGYREGEN) vehicles_regen(vehic, vehic.cnt, vehicle_energy, autocvar_g_vehicle_raptor_energy, autocvar_g_vehicle_raptor_energy_regen_pause, autocvar_g_vehicle_raptor_energy_regen, dt, false); @@ -481,7 +481,7 @@ bool raptor_takeoff(entity this, float dt) this.vehicle_reload2 = bound(0, vehic.bomb1.alpha * 100, 100); this.vehicle_ammo2 = (this.vehicle_reload2 == 100) ? 100 : 0; - VEHICLE_UPDATE_PLAYER_RESOURCE(this, vehic, health, raptor, RESOURCE_HEALTH); + VEHICLE_UPDATE_PLAYER_RESOURCE(this, vehic, health, raptor, RES_HEALTH); VEHICLE_UPDATE_PLAYER(this, vehic, energy, raptor); if(vehic.vehicle_flags & VHF_HASSHIELD) VEHICLE_UPDATE_PLAYER(this, vehic, shield, raptor); @@ -594,7 +594,7 @@ METHOD(Raptor, vr_enter, void(Raptor thisveh, entity instance)) instance.owner.PlayerPhysplug = raptor_takeoff; set_movetype(instance, MOVETYPE_BOUNCEMISSILE); instance.solid = SOLID_SLIDEBOX; - instance.owner.vehicle_health = (GetResourceAmount(instance, RESOURCE_HEALTH) / autocvar_g_vehicle_raptor_health) * 100; + instance.owner.vehicle_health = (GetResource(instance, RES_HEALTH) / autocvar_g_vehicle_raptor_health) * 100; instance.owner.vehicle_shield = (instance.vehicle_shield / autocvar_g_vehicle_raptor_shield) * 100; instance.velocity = '0 0 1'; // nudge upwards so takeoff sequence can work instance.tur_head.exteriormodeltoclient = instance.owner; @@ -609,7 +609,7 @@ METHOD(Raptor, vr_enter, void(Raptor thisveh, entity instance)) } METHOD(Raptor, vr_death, void(Raptor thisveh, entity instance)) { - SetResourceAmountExplicit(instance, RESOURCE_HEALTH, 0); + SetResourceExplicit(instance, RES_HEALTH, 0); instance.event_damage = func_null; instance.solid = SOLID_CORPSE; instance.takedamage = DAMAGE_NO; @@ -701,7 +701,7 @@ METHOD(Raptor, vr_spawn, void(Raptor thisveh, entity instance)) } instance.frame = 0; - SetResourceAmountExplicit(instance, RESOURCE_HEALTH, autocvar_g_vehicle_raptor_health); + SetResourceExplicit(instance, RES_HEALTH, autocvar_g_vehicle_raptor_health); instance.vehicle_shield = autocvar_g_vehicle_raptor_shield; set_movetype(instance, MOVETYPE_TOSS); instance.solid = SOLID_SLIDEBOX; @@ -720,7 +720,7 @@ METHOD(Raptor, vr_spawn, void(Raptor thisveh, entity instance)) instance.bouncefactor = autocvar_g_vehicle_raptor_bouncefactor; instance.bouncestop = autocvar_g_vehicle_raptor_bouncestop; instance.damageforcescale = 0.25; - SetResourceAmountExplicit(instance, RESOURCE_HEALTH, autocvar_g_vehicle_raptor_health); + SetResourceExplicit(instance, RES_HEALTH, autocvar_g_vehicle_raptor_health); instance.vehicle_shield = autocvar_g_vehicle_raptor_shield; } METHOD(Raptor, vr_setup, void(Raptor thisveh, entity instance)) @@ -739,9 +739,9 @@ METHOD(Raptor, vr_setup, void(Raptor thisveh, entity instance)) instance.vehicle_exit = raptor_exit; instance.respawntime = autocvar_g_vehicle_raptor_respawntime; - SetResourceAmountExplicit(instance, RESOURCE_HEALTH, autocvar_g_vehicle_raptor_health); + SetResourceExplicit(instance, RES_HEALTH, autocvar_g_vehicle_raptor_health); instance.vehicle_shield = autocvar_g_vehicle_raptor_shield; - instance.max_health = GetResourceAmount(instance, RESOURCE_HEALTH); + instance.max_health = GetResource(instance, RES_HEALTH); if(!autocvar_g_vehicle_raptor_swim) instance.dphitcontentsmask |= DPCONTENTS_LIQUIDSMASK;