Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- version "4.2.4"
- Class Peony : DoomPlayer
- {
- Override Void CheckJump()
- {
- If (!(Player.Cheats & CF_FROZEN))
- {
- Let Player = Self.Player;
- // [RH] check for jump
- If (Player.cmd.Buttons & BT_JUMP)
- {
- If (Player.CrouchOffset != 0)
- {
- // Jumping while crouching will force an un-crouch but not jump
- Player.Crouching = 1;
- }
- Else If (waterlevel >= 2)
- {
- Vel.Z = 4 * Speed;
- }
- Else If (bNoGravity)
- {
- Vel.Z = 3.0;
- }
- Else If (!(GetPlayerInput(INPUT_OLDBUTTONS) & BT_JUMP))
- {
- If (/*Level.IsJumpingAllowed() &&*/ Player.OnGround /*&& Player.JumpTics == 0*/) //[DoomKrakken]: DOOMGUY KNOWS NO BOUNDS.
- {
- Double JumpVelZ = JumpZ * 35 / TICRATE;
- Double JumpFac = 0;
- // [BC] If the player has the high jump power, double his jump velocity.
- // (actually, pick the best factors from all active items.)
- For (Let p = Inv; p != Null; p = p.Inv)
- {
- Let pp = PowerHighJump(p);
- If (pp)
- {
- Double f = pp.Strength;
- If (f > JumpFac) JumpFac = f;
- }
- }
- If (JumpFac > 0) JumpVelZ *= JumpFac;
- Vel.Z += JumpVelZ;
- bONMOBJ = False;
- Player.JumpTics = -1;
- If (!(Player.Cheats & CF_PREDICTING))
- {
- A_PlaySound("Player/Jump", CHAN_BODY);
- }
- }
- Else If (!Player.OnGround && CountInv("DoubleJumpCounter"))
- {
- If (!(Player.Cheats & CF_PREDICTING))
- {
- A_PlaySound("Player/Jump", CHAN_BODY);
- A_TakeInventory("DoubleJumpCounter");
- }
- Double JumpVelZ = JumpZ * 35 / TICRATE;
- Double JumpFac = 0;
- If (Vel.Z <= JumpVelZ)
- {
- Vel = (Vel.X, Vel.Y, JumpVelZ);
- }
- Else
- {
- Vel += (0, 0, JumpVelZ);
- }
- }
- }
- }
- }
- }
- Override Void Tick()
- {
- If (!Player || !Player.Mo || Player.Mo != Self) //[DoomKrakken]: Voodoo doll handling.
- {
- Super.Tick();
- Return;
- }
- If (Player.OnGround) //[DoomKrakken]: Player.OnGround checks if the player is on the ground or on an actor.
- {
- A_GiveInventory("DoubleJumpCounter");
- }
- Super.Tick();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement