From: Mario Date: Fri, 14 Sep 2018 20:01:22 +0000 (+1000) Subject: Tweak bumblebee's cannons a bit X-Git-Tag: xonotic-v0.8.5~1868 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a70756e26173d722900f989e2a31ad05afb79ac5;p=xonotic%2Fxonotic-data.pk3dir.git Tweak bumblebee's cannons a bit --- diff --git a/qcsrc/common/vehicles/sv_vehicles.qc b/qcsrc/common/vehicles/sv_vehicles.qc index 60df77090..2f5e8e46b 100644 --- a/qcsrc/common/vehicles/sv_vehicles.qc +++ b/qcsrc/common/vehicles/sv_vehicles.qc @@ -385,7 +385,7 @@ bool vehicle_addplayerslot( entity _owner, vector vehicle_aimturret(entity _vehic, vector _target, entity _turrret, string _tagname, float _pichlimit_min, float _pichlimit_max, - float _rotlimit_min, float _rotlimit_max, float _aimspeed) + float _rotlimit_min, float _rotlimit_max, float _aimspeed, float dt) { vector vtmp, vtag; float ftmp; @@ -393,7 +393,7 @@ vector vehicle_aimturret(entity _vehic, vector _target, entity _turrret, string vtmp = vectoangles(normalize(_target - vtag)); vtmp = AnglesTransform_ToAngles(AnglesTransform_LeftDivide(AnglesTransform_FromAngles(_vehic.angles), AnglesTransform_FromAngles(vtmp))) - _turrret.angles; vtmp = AnglesTransform_Normalize(vtmp, true); - ftmp = _aimspeed * frametime; + ftmp = _aimspeed * dt; vtmp_y = bound(-ftmp, vtmp_y, ftmp); vtmp_x = bound(-ftmp, vtmp_x, ftmp); _turrret.angles_y = bound(_rotlimit_min, _turrret.angles_y + vtmp_y, _rotlimit_max); diff --git a/qcsrc/common/vehicles/vehicle/bumblebee.qc b/qcsrc/common/vehicles/vehicle/bumblebee.qc index f8620230c..5780d6657 100644 --- a/qcsrc/common/vehicles/vehicle/bumblebee.qc +++ b/qcsrc/common/vehicles/vehicle/bumblebee.qc @@ -33,9 +33,9 @@ float autocvar_g_vehicle_bumblebee_cannon_ammo = 100; float autocvar_g_vehicle_bumblebee_cannon_ammo_regen = 100; float autocvar_g_vehicle_bumblebee_cannon_ammo_regen_pause = 1; -float autocvar_g_vehicle_bumblebee_cannon_lock = 0; +float autocvar_g_vehicle_bumblebee_cannon_lock = 1; -float autocvar_g_vehicle_bumblebee_cannon_turnspeed = 160; +float autocvar_g_vehicle_bumblebee_cannon_turnspeed = 260; float autocvar_g_vehicle_bumblebee_cannon_pitchlimit_down = 60; float autocvar_g_vehicle_bumblebee_cannon_pitchlimit_up = 60; float autocvar_g_vehicle_bumblebee_cannon_turnlimit_in = 20; @@ -105,20 +105,28 @@ bool bumblebee_gunner_frame(entity this, float dt) if(autocvar_g_vehicle_bumblebee_cannon_lock) { - if(gun.lock_time < time) + if(gun.lock_time < time || IS_DEAD(gun.enemy) || STAT(FROZEN, gun.enemy)) gun.enemy = NULL; if(trace_ent) - if(trace_ent.move_movetype) - if(trace_ent.takedamage) - if(!IS_DEAD(trace_ent) && !STAT(FROZEN, trace_ent)) - { - if(DIFF_TEAM(trace_ent, this)) - { - gun.enemy = trace_ent; - gun.lock_time = time + 5; - } - } + if(trace_ent.move_movetype) + if(trace_ent.takedamage) + if(!IS_DEAD(trace_ent) && !STAT(FROZEN, trace_ent)) + { + if(teamplay) + { + if(DIFF_TEAM(trace_ent, this)) + { + gun.enemy = trace_ent; + gun.lock_time = time + 2.5; + } + } + else + { + gun.enemy = trace_ent; + gun.lock_time = time + 0.5; + } + } } if(gun.enemy) @@ -141,13 +149,13 @@ bool bumblebee_gunner_frame(entity this, float dt) UpdateAuxiliaryXhair(this, ad, '1 0 1', 1); vehicle_aimturret(vehic, trace_endpos, gun, "fire", autocvar_g_vehicle_bumblebee_cannon_pitchlimit_down * -1, autocvar_g_vehicle_bumblebee_cannon_pitchlimit_up, - _out * -1, _in, autocvar_g_vehicle_bumblebee_cannon_turnspeed); + _out * -1, _in, autocvar_g_vehicle_bumblebee_cannon_turnspeed, dt); } else vehicle_aimturret(vehic, _ct, gun, "fire", autocvar_g_vehicle_bumblebee_cannon_pitchlimit_down * -1, autocvar_g_vehicle_bumblebee_cannon_pitchlimit_up, - _out * -1, _in, autocvar_g_vehicle_bumblebee_cannon_turnspeed); + _out * -1, _in, autocvar_g_vehicle_bumblebee_cannon_turnspeed, dt); if(!forbidWeaponUse(this)) if(PHYS_INPUT_BUTTON_ATCK(this)) @@ -521,7 +529,7 @@ bool bumblebee_pilot_frame(entity this, float dt) vang = vehicle_aimturret(vehic, trace_endpos, vehic.gun3, "fire", 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); + 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((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)) diff --git a/qcsrc/common/vehicles/vehicle/bumblebee_weapons.qh b/qcsrc/common/vehicles/vehicle/bumblebee_weapons.qh index e9c5bf41d..f6909fb42 100644 --- a/qcsrc/common/vehicles/vehicle/bumblebee_weapons.qh +++ b/qcsrc/common/vehicles/vehicle/bumblebee_weapons.qh @@ -8,7 +8,7 @@ float autocvar_g_vehicle_bumblebee_cannon_damage = 60; float autocvar_g_vehicle_bumblebee_cannon_radius = 225; float autocvar_g_vehicle_bumblebee_cannon_refire = 0.2; float autocvar_g_vehicle_bumblebee_cannon_speed = 20000; -float autocvar_g_vehicle_bumblebee_cannon_spread = 0.02; +float autocvar_g_vehicle_bumblebee_cannon_spread = 0; float autocvar_g_vehicle_bumblebee_cannon_force = -35; #endif diff --git a/qcsrc/common/vehicles/vehicle/raptor.qc b/qcsrc/common/vehicles/vehicle/raptor.qc index 7591954f4..0150ee98f 100644 --- a/qcsrc/common/vehicles/vehicle/raptor.qc +++ b/qcsrc/common/vehicles/vehicle/raptor.qc @@ -343,11 +343,11 @@ bool raptor_frame(entity this, float dt) vehicle_aimturret(vehic, trace_endpos, vehic.gun1, "fire1", autocvar_g_vehicle_raptor_cannon_pitchlimit_down * -1, autocvar_g_vehicle_raptor_cannon_pitchlimit_up, - autocvar_g_vehicle_raptor_cannon_turnlimit * -1, autocvar_g_vehicle_raptor_cannon_turnlimit, autocvar_g_vehicle_raptor_cannon_turnspeed); + autocvar_g_vehicle_raptor_cannon_turnlimit * -1, autocvar_g_vehicle_raptor_cannon_turnlimit, autocvar_g_vehicle_raptor_cannon_turnspeed, dt); vehicle_aimturret(vehic, trace_endpos, vehic.gun2, "fire1", autocvar_g_vehicle_raptor_cannon_pitchlimit_down * -1, autocvar_g_vehicle_raptor_cannon_pitchlimit_up, - autocvar_g_vehicle_raptor_cannon_turnlimit * -1, autocvar_g_vehicle_raptor_cannon_turnlimit, autocvar_g_vehicle_raptor_cannon_turnspeed); + autocvar_g_vehicle_raptor_cannon_turnlimit * -1, autocvar_g_vehicle_raptor_cannon_turnlimit, autocvar_g_vehicle_raptor_cannon_turnspeed, dt); /* ad = ad * 0.5;