]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Dodging while frozen requires only 1 key push
authorMario <mario.mario@y7mail.com>
Thu, 8 Aug 2013 19:41:16 +0000 (05:41 +1000)
committerMario <mario.mario@y7mail.com>
Thu, 8 Aug 2013 19:41:16 +0000 (05:41 +1000)
mutators.cfg
qcsrc/server/mutators/mutator_dodging.qc

index b43bc006aa7d5bc982db7d11fd4c2562d485aeb2..44739e06d7564e9e3edd1ba383c184c62e1df4b5 100644 (file)
@@ -11,7 +11,7 @@ set g_dodging 0 "set to 1 to enable dodging in games"
 seta cl_dodging_timeout 0.2 "determines how long apart (in seconds) two taps on the same direction key are considered a dodge. use 0 to disable"
 
 set sv_dodging_wall_dodging 0 "set to 1 to allow dodging off walls. 0 to disable"
-set sv_dodging_delay 0.5 "determines how long a player has to wait to be able to dodge again after dodging"
+set sv_dodging_delay 0.7 "determines how long a player has to wait to be able to dodge again after dodging"
 set sv_dodging_up_speed 200 "the jump velocity of the dodge"
 set sv_dodging_horiz_speed 400 "the horizontal velocity of the dodge"
 set sv_dodging_horiz_speed_frozen 200 "the horizontal velocity of the dodge while frozen"
index 0101b98c5c477b1be8812ac4086023c5d8982ebf..263df8225f3f365746239fec3fca43c3d13b41ae 100644 (file)
@@ -168,6 +168,9 @@ MUTATOR_HOOKFUNCTION(dodging_GetPressedKeys) {
 
        tap_direction_x = 0;
        tap_direction_y = 0;
+       
+       float frozen_dodging;
+       frozen_dodging = (self.freezetag_frozen && autocvar_sv_dodging_frozen);
 
        float dodge_detected;
        if (g_dodging == 0)
@@ -185,7 +188,7 @@ MUTATOR_HOOKFUNCTION(dodging_GetPressedKeys) {
 
        if (self.movement_x > 0) {
                // is this a state change?
-               if (!(self.pressedkeys & KEY_FORWARD)) {
+               if (!(self.pressedkeys & KEY_FORWARD) || frozen_dodging) {
                        if ((time - self.last_FORWARD_KEY_time) < self.cvar_cl_dodging_timeout) { 
                                tap_direction_x = 1.0;
                                dodge_detected = 1;
@@ -196,7 +199,7 @@ MUTATOR_HOOKFUNCTION(dodging_GetPressedKeys) {
 
        if (self.movement_x < 0) {
                // is this a state change?
-               if (!(self.pressedkeys & KEY_BACKWARD)) {
+               if (!(self.pressedkeys & KEY_BACKWARD) || frozen_dodging) {
                        tap_direction_x = -1.0;
                        if ((time - self.last_BACKWARD_KEY_time) < self.cvar_cl_dodging_timeout)        { 
                                dodge_detected = 1;
@@ -207,7 +210,7 @@ MUTATOR_HOOKFUNCTION(dodging_GetPressedKeys) {
 
        if (self.movement_y > 0) {
                // is this a state change?
-               if (!(self.pressedkeys & KEY_RIGHT)) {
+               if (!(self.pressedkeys & KEY_RIGHT) || frozen_dodging) {
                        tap_direction_y = 1.0;
                        if ((time - self.last_RIGHT_KEY_time) < self.cvar_cl_dodging_timeout)   { 
                                dodge_detected = 1;
@@ -218,7 +221,7 @@ MUTATOR_HOOKFUNCTION(dodging_GetPressedKeys) {
 
        if (self.movement_y < 0) {
                // is this a state change?
-               if (!(self.pressedkeys & KEY_LEFT)) {
+               if (!(self.pressedkeys & KEY_LEFT) || frozen_dodging) {
                        tap_direction_y = -1.0;
                        if ((time - self.last_LEFT_KEY_time) < self.cvar_cl_dodging_timeout)    { 
                                dodge_detected = 1;