Advertisement
Guest User

Untitled

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