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