From 04e6f5c75817a7773cdb658ea3abb635bc6c8fa4 Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 4 Mar 2015 17:35:21 +1100 Subject: [PATCH] Allow spiderbot to sprint by holding jump --- qcsrc/common/vehicles/unit/spiderbot.qc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/qcsrc/common/vehicles/unit/spiderbot.qc b/qcsrc/common/vehicles/unit/spiderbot.qc index 9b961b509..d66d979e1 100644 --- a/qcsrc/common/vehicles/unit/spiderbot.qc +++ b/qcsrc/common/vehicles/unit/spiderbot.qc @@ -29,6 +29,7 @@ float autocvar_g_vehicle_spiderbot_respawntime; float autocvar_g_vehicle_spiderbot_speed_stop; float autocvar_g_vehicle_spiderbot_speed_strafe; float autocvar_g_vehicle_spiderbot_speed_walk; +float autocvar_g_vehicle_spiderbot_speed_run = 700; float autocvar_g_vehicle_spiderbot_turnspeed; float autocvar_g_vehicle_spiderbot_turnspeed_strafe; float autocvar_g_vehicle_spiderbot_movement_inertia; @@ -402,7 +403,10 @@ float spiderbot_frame() spider.frame = 5; } - if((spider.flags & FL_ONGROUND) && player.BUTTON_JUMP && self.tur_head.wait < time) + if(!player.BUTTON_JUMP) + spider.BUTTON_JUMP = 0; + + if((spider.flags & FL_ONGROUND) && player.BUTTON_JUMP && !spider.BUTTON_JUMP && self.tur_head.wait < time) { sound (self, CH_TRIGGER_SINGLE, "vehicles/spiderbot_jump.wav", VOL_VEHICLEENGINE, ATTEN_NORM); //dprint("spiderbot_jump:", ftos(soundlength("vehicles/spiderbot_jump.wav")), "\n"); @@ -410,7 +414,8 @@ float spiderbot_frame() self.tur_head.wait = time + 2; spider.jump_delay = time + 2; - player.BUTTON_JUMP = 0; + spider.BUTTON_JUMP = 1; // set spider's jump + //player.BUTTON_JUMP = 0; vector movefix = '0 0 0'; if(player.movement_x > 0) movefix_x = 1; @@ -473,7 +478,7 @@ float spiderbot_frame() } player.movement_y = 0; float oldvelz = spider.velocity_z; - movelib_move_simple(normalize(v_forward * player.movement_x),autocvar_g_vehicle_spiderbot_speed_walk,autocvar_g_vehicle_spiderbot_movement_inertia); + movelib_move_simple(normalize(v_forward * player.movement_x),((player.BUTTON_JUMP) ? autocvar_g_vehicle_spiderbot_speed_run : autocvar_g_vehicle_spiderbot_speed_walk),autocvar_g_vehicle_spiderbot_movement_inertia); spider.velocity_z = oldvelz; float g = ((autocvar_sv_gameplayfix_gravityunaffectedbyticrate) ? 0.5 : 1); if(spider.velocity_z <= 20) // not while jumping -- 2.39.2