#include "bumblebee.qh"
-#ifdef IMPLEMENTATION
-
const float BRG_SETUP = 2;
const float BRG_START = 4;
const float BRG_END = 8;
_out = autocvar_g_vehicle_bumblebee_cannon_turnlimit_in;
setorigin(this, vehic.origin + v_up * -16 + v_forward * -16 + v_right * -128);
}
+ this.oldorigin = this.origin; // negate fall damage
crosshair_trace(this);
vector _ct = trace_endpos;
player.PlayerPhysplug = func_null;
player.view_ofs = STAT(PL_VIEW_OFS, player);
player.event_damage = PlayerDamage;
- player.hud = HUD_NORMAL;
+ STAT(HUD, player) = HUD_NORMAL;
player.teleportable = TELEPORT_NORMAL;
for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
{
set_movetype(player, MOVETYPE_NOCLIP);
player.event_damage = func_null;
player.view_ofs = '0 0 0';
- player.hud = gunner.hud;
+ STAT(HUD, player) = STAT(HUD, gunner);
player.teleportable = false;
player.PlayerPhysplug = gunner.PlayerPhysplug;
player.vehicle_ammo1 = vehic.vehicle_ammo1;
WriteAngle(MSG_ONE, 0); // roll
}
- CSQCVehicleSetup(player, player.hud);
+ CSQCVehicleSetup(player, STAT(HUD, player));
MUTATOR_CALLHOOK(VehicleEnter, player, gunner);
entity vehic = this.vehicle;
return = true;
- if(gameover)
+ if(game_stopped)
{
vehic.solid = SOLID_NOT;
vehic.takedamage = DAMAGE_NO;
// Pitch
ftmp = 0;
- if(this.movement.x > 0 && vang.x < autocvar_g_vehicle_bumblebee_pitchlimit)
+ if(CS(this).movement.x > 0 && vang.x < autocvar_g_vehicle_bumblebee_pitchlimit)
ftmp = 4;
- else if(this.movement.x < 0 && vang.x > -autocvar_g_vehicle_bumblebee_pitchlimit)
+ else if(CS(this).movement.x < 0 && vang.x > -autocvar_g_vehicle_bumblebee_pitchlimit)
ftmp = -8;
newvel.x = bound(-autocvar_g_vehicle_bumblebee_pitchlimit, newvel.x , autocvar_g_vehicle_bumblebee_pitchlimit);
makevectors('0 1 0' * vehic.angles.y);
newvel = vehic.velocity * -autocvar_g_vehicle_bumblebee_friction;
- if(this.movement.x != 0)
+ if(CS(this).movement.x != 0)
{
- if(this.movement.x > 0)
+ if(CS(this).movement.x > 0)
newvel += v_forward * autocvar_g_vehicle_bumblebee_speed_forward;
- else if(this.movement.x < 0)
+ else if(CS(this).movement.x < 0)
newvel -= v_forward * autocvar_g_vehicle_bumblebee_speed_forward;
}
- if(this.movement.y != 0)
+ if(CS(this).movement.y != 0)
{
- if(this.movement.y < 0)
+ if(CS(this).movement.y < 0)
newvel -= v_right * autocvar_g_vehicle_bumblebee_speed_strafe;
- else if(this.movement.y > 0)
+ else if(CS(this).movement.y > 0)
newvel += v_right * autocvar_g_vehicle_bumblebee_speed_strafe;
ftmp = newvel * v_right;
ftmp *= dt * 0.1;
newvel += v_up * autocvar_g_vehicle_bumblebee_speed_up;
vehic.velocity += newvel * dt;
- this.velocity = this.movement = vehic.velocity;
+ this.velocity = CS(this).movement = vehic.velocity;
if(autocvar_g_vehicle_bumblebee_healgun_locktime)
{
if(autocvar_g_vehicle_bumblebee_raygun)
{
- Damage(trace_ent, vehic, this, autocvar_g_vehicle_bumblebee_raygun_dps * PHYS_INPUT_FRAMETIME, DEATH_GENERIC.m_id, trace_endpos, v_forward * autocvar_g_vehicle_bumblebee_raygun_fps * PHYS_INPUT_FRAMETIME);
+ Damage(trace_ent, vehic, this, autocvar_g_vehicle_bumblebee_raygun_dps * PHYS_INPUT_FRAMETIME, DEATH_GENERIC.m_id, DMG_NOWEP, trace_endpos, v_forward * autocvar_g_vehicle_bumblebee_raygun_fps * PHYS_INPUT_FRAMETIME);
vehic.vehicle_energy -= autocvar_g_vehicle_bumblebee_raygun_aps * PHYS_INPUT_FRAMETIME;
}
else
{
if(!IS_DEAD(trace_ent))
+ {
if((teamplay && trace_ent.team == this.team) || !teamplay)
{
+ if(autocvar_g_vehicle_bumblebee_healgun_hps)
+ {
+ float hplimit = ((IS_PLAYER(trace_ent)) ? autocvar_g_vehicle_bumblebee_healgun_hmax : -1);
+ Heal(trace_ent, this, autocvar_g_vehicle_bumblebee_healgun_hps * dt, hplimit);
+ }
if(IS_VEHICLE(trace_ent))
{
if(autocvar_g_vehicle_bumblebee_healgun_sps && trace_ent.vehicle_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);
-
- if(autocvar_g_vehicle_bumblebee_healgun_hps)
- trace_ent.vehicle_health = min(trace_ent.vehicle_health + autocvar_g_vehicle_bumblebee_healgun_hps * dt, trace_ent.max_health);
}
else if(IS_CLIENT(trace_ent))
{
- if(trace_ent.health <= autocvar_g_vehicle_bumblebee_healgun_hmax && autocvar_g_vehicle_bumblebee_healgun_hps)
- trace_ent.health = min(trace_ent.health + autocvar_g_vehicle_bumblebee_healgun_hps * dt, autocvar_g_vehicle_bumblebee_healgun_hmax);
-
- if(trace_ent.armorvalue <= autocvar_g_vehicle_bumblebee_healgun_amax && autocvar_g_vehicle_bumblebee_healgun_aps)
- trace_ent.armorvalue = min(trace_ent.armorvalue + autocvar_g_vehicle_bumblebee_healgun_aps * dt, autocvar_g_vehicle_bumblebee_healgun_amax);
-
- trace_ent.health = min(trace_ent.health + autocvar_g_vehicle_bumblebee_healgun_hps * dt, autocvar_g_vehicle_bumblebee_healgun_hmax);
- }
- else if(IS_TURRET(trace_ent))
- {
- if(trace_ent.health <= trace_ent.max_health && autocvar_g_vehicle_bumblebee_healgun_hps)
- trace_ent.health = min(trace_ent.health + autocvar_g_vehicle_bumblebee_healgun_hps * dt, trace_ent.max_health);
- //else ..hmmm what? ammo?
-
- trace_ent.SendFlags |= TNSF_STATUS;
+ 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);
}
}
+ }
}
}
makevectors(vehic.angles);
vehic.angles_x *= -1;
setorigin(this, vehic.origin + v_up * 48 + v_forward * 160);
+ this.oldorigin = this.origin; // negate fall damage
PHYS_INPUT_BUTTON_ATCK(this) = PHYS_INPUT_BUTTON_ATCK2(this) = PHYS_INPUT_BUTTON_CROUCH(this) = false;
}
else
spot = this.origin + v_up * 128 - v_forward * 300;
- spot = vehicles_findgoodexit(this, spot);
+ spot = vehicles_findgoodexit(this, this.owner, spot);
// Hide beam
if(this.gun3.enemy || !wasfreed(this.gun3.enemy))
autocvar_g_vehicle_bumblebee_blowup_edgedamage,
autocvar_g_vehicle_bumblebee_blowup_radius, this, NULL,
autocvar_g_vehicle_bumblebee_blowup_forceintensity,
- DEATH_VH_BUMB_DEATH.m_id, NULL);
+ DEATH_VH_BUMB_DEATH.m_id, DMG_NOWEP, NULL);
sound(this, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
Send_Effect(EFFECT_EXPLOSION_BIG, (this.origin + '0 0 100') + (randomvec() * 80), '0 0 0', 1);
Send_Effect(EFFECT_EXPLOSION_MEDIUM, findbetterlocation(instance.origin, 16), '0 0 0', 1);
- instance.health = 0;
+ SetResourceAmountExplicit(instance, RESOURCE_HEALTH, 0);
instance.event_damage = func_null;
instance.solid = SOLID_NOT;
instance.takedamage = DAMAGE_NO;
}
#endif
-#endif