+#ifdef SVQC
+ #include "../_all.qh"
+ #include "mutator.qh"
+ #include "../antilag.qh"
+#endif
+
.float multijump_count;
.float multijump_ready;
float PM_multijump_checkjump()
{
- if(!PHYS_MULTIJUMP) { return FALSE; }
+ if(!PHYS_MULTIJUMP) { return false; }
if (!IS_JUMP_HELD(self) && !IS_ONGROUND(self)) // jump button pressed this frame and we are in midair
- self.multijump_ready = TRUE; // this is necessary to check that we released the jump button and pressed it again
+ self.multijump_ready = true; // this is necessary to check that we released the jump button and pressed it again
else
- self.multijump_ready = FALSE;
+ self.multijump_ready = false;
if(!player_multijump && self.multijump_ready && (self.multijump_count < PHYS_MULTIJUMP || PHYS_MULTIJUMP == -1) && self.velocity_z > PHYS_MULTIJUMP_SPEED)
{
{
if (self.velocity_z < PHYS_JUMPVELOCITY)
{
- player_multijump = TRUE;
+ player_multijump = true;
self.velocity_z = 0;
}
}
else
- player_multijump = TRUE;
+ player_multijump = true;
if(player_multijump)
{
- if(PHYS_INPUT_MOVEVALUES(self)_x != 0 || PHYS_INPUT_MOVEVALUES(self)_y != 0) // don't remove all speed if player isnt pressing any movement keys
+ if(self.movement_x != 0 || self.movement_y != 0) // don't remove all speed if player isnt pressing any movement keys
{
float curspeed;
vector wishvel, wishdir;
curspeed = vlen(vec2(self.velocity));
#endif
- makevectors(PHYS_INPUT_ANGLES(self)_y * '0 1 0');
- wishvel = v_forward * PHYS_INPUT_MOVEVALUES(self)_x + v_right * PHYS_INPUT_MOVEVALUES(self)_y;
+ makevectors(self.v_angle_y * '0 1 0');
+ wishvel = v_forward * self.movement_x + v_right * self.movement_y;
wishdir = normalize(wishvel);
self.velocity_x = wishdir_x * curspeed; // allow "dodging" at a multijump
self.multijump_count += 1;
}
}
- self.multijump_ready = FALSE; // require releasing and pressing the jump button again for the next jump
+ self.multijump_ready = false; // require releasing and pressing the jump button again for the next jump
}
- return FALSE;
+ return false;
}
#ifdef SVQC
multijump_UpdateStats();
PM_multijump();
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(multijump_PlayerJump)
MUTATOR_HOOKFUNCTION(multijump_BuildMutatorsString)
{
ret_string = strcat(ret_string, ":multijump");
- return FALSE;
+ return false;
}
MUTATOR_HOOKFUNCTION(multijump_BuildMutatorsPrettyString)
{
ret_string = strcat(ret_string, ", Multi jump");
- return FALSE;
+ return false;
}
MUTATOR_DEFINITION(mutator_multijump)
multijump_AddStats();
}
- return FALSE;
+ return false;
}
#endif