Advertisement
Guest User

Untitled

a guest
Dec 15th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 KB | None | 0 0
  1. version "4.2.4"
  2.  
  3. Class Peony : DoomPlayer
  4. {
  5.  
  6. Override Void CheckJump()
  7. {
  8. If (!(Player.Cheats & CF_FROZEN))
  9. {
  10. Let Player = Self.Player;
  11. // [RH] check for jump
  12. If (Player.cmd.Buttons & BT_JUMP)
  13. {
  14. If (Player.CrouchOffset != 0)
  15. {
  16. // Jumping while crouching will force an un-crouch but not jump
  17. Player.Crouching = 1;
  18. }
  19. Else If (waterlevel >= 2)
  20. {
  21. Vel.Z = 4 * Speed;
  22. }
  23. Else If (bNoGravity)
  24. {
  25. Vel.Z = 3.0;
  26. }
  27. Else If (!(GetPlayerInput(INPUT_OLDBUTTONS) & BT_JUMP))
  28. {
  29. If (/*Level.IsJumpingAllowed() &&*/ Player.OnGround /*&& Player.JumpTics == 0*/) //[DoomKrakken]: DOOMGUY KNOWS NO BOUNDS.
  30. {
  31. Double JumpVelZ = JumpZ * 35 / TICRATE;
  32. Double JumpFac = 0;
  33.  
  34. // [BC] If the player has the high jump power, double his jump velocity.
  35. // (actually, pick the best factors from all active items.)
  36. For (Let p = Inv; p != Null; p = p.Inv)
  37. {
  38. Let pp = PowerHighJump(p);
  39. If (pp)
  40. {
  41. Double f = pp.Strength;
  42. If (f > JumpFac) JumpFac = f;
  43. }
  44. }
  45. If (JumpFac > 0) JumpVelZ *= JumpFac;
  46.  
  47. Vel.Z += JumpVelZ;
  48. bONMOBJ = False;
  49. Player.JumpTics = -1;
  50. If (!(Player.Cheats & CF_PREDICTING))
  51. {
  52. A_PlaySound("Player/Jump", CHAN_BODY);
  53. }
  54. }
  55. Else If (!Player.OnGround && CountInv("DoubleJumpCounter"))
  56. {
  57. If (!(Player.Cheats & CF_PREDICTING))
  58. {
  59. A_PlaySound("Player/Jump", CHAN_BODY);
  60. A_TakeInventory("DoubleJumpCounter");
  61. }
  62. Double JumpVelZ = JumpZ * 35 / TICRATE;
  63. Double JumpFac = 0;
  64. If (Vel.Z <= JumpVelZ)
  65. {
  66. Vel = (Vel.X, Vel.Y, JumpVelZ);
  67. }
  68. Else
  69. {
  70. Vel += (0, 0, JumpVelZ);
  71. }
  72. }
  73. }
  74. }
  75. }
  76. }
  77. Override Void Tick()
  78. {
  79. If (!Player || !Player.Mo || Player.Mo != Self) //[DoomKrakken]: Voodoo doll handling.
  80. {
  81. Super.Tick();
  82. Return;
  83. }
  84.  
  85. If (Player.OnGround) //[DoomKrakken]: Player.OnGround checks if the player is on the ground or on an actor.
  86. {
  87. A_GiveInventory("DoubleJumpCounter");
  88. }
  89. Super.Tick();
  90.  
  91. }
  92.  
  93. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement