From 787c7289df2ae94af5a34a9927190c5e49e26eab Mon Sep 17 00:00:00 2001 From: mand1nga Date: Fri, 3 Apr 2009 13:51:31 +0000 Subject: [PATCH] Improved jetpack usage and rocket jumping git-svn-id: svn://svn.icculus.org/nexuiz/trunk@6420 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/qcsrc/server/havocbot.qc | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/data/qcsrc/server/havocbot.qc b/data/qcsrc/server/havocbot.qc index 68f70704b..fb43db6ee 100644 --- a/data/qcsrc/server/havocbot.qc +++ b/data/qcsrc/server/havocbot.qc @@ -356,6 +356,7 @@ void havocbot_movetogoal() } // If there is a trigger_hurt right below try to use the jetpack or make a rocketjump + if(skill>6) if not(self.flags & FL_ONGROUND) { tracebox(self.origin, self.mins, self.maxs, self.origin + '0 0 -65536', MOVE_NOMONSTERS, self); @@ -374,18 +375,49 @@ void havocbot_movetogoal() } else self.BUTTON_HOOK = TRUE; + + // If there is no goal try to move forward + if(self.goalcurrent==world) + { + local float speed = fabs(self.velocity_x) + fabs(self.velocity_y); + + if(speed > (maxspeed / 1.5) && speed > (maxspeed / 4)) + { + self.movement_x = 0; + } + else + { + makevectors(self.v_angle_y * '0 1 0'); + tracebox(self.origin, self.mins, self.maxs, self.origin + (v_forward * maxspeed * 3), MOVE_NOMONSTERS, self); + + if(trace_fraction==1) + { + if(speed < (maxspeed / 2)) + self.movement_x = maxspeed; + } + } + } } else if(self.health>cvar("g_balance_rocketlauncher_damage")*0.5) { - if(self.velocity_z < -maxspeed) + if(self.velocity_z < 0) if(client_hasweapon(self, WEP_ROCKET_LAUNCHER, TRUE, FALSE)) { self.switchweapon = WEP_ROCKET_LAUNCHER; self.v_angle_x = 90; + self.movement_x = maxspeed; self.BUTTON_ATCK = TRUE; self.BUTTON_ATCK2 = TRUE; + return; } } + else + { + // If there is no goal try to move forward + if(self.velocity_z<0) + if(self.goalcurrent==world) + self.movement_x = maxspeed; + } } // If we are under water with no goals, swim up -- 2.39.2