frozenLake

Untitled

Apr 19th, 2014
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. addHook("MobjThinker", function(mobj)
  2. local player = mobj.player
  3. local swimming = 0
  4.  
  5. if swimming == 0 & (player.pflags & PF_JUMPED) & (player.cmd.buttons & BT_USE)
  6. swimming = 1
  7. end
  8.  
  9. if not player.powers[pw_underwater]
  10. and not player.powers[pw_super]
  11. swimming = 0
  12. end
  13.  
  14. if (player.powers[pw_underwater] | player.powers[pw_super]) & swimming == 1
  15. and (player.cmd.buttons & BT_JUMP)
  16. and not (player.pflags & PF_NIGHTSMODE)
  17. and not (player.pflags & PF_ROPEHANG)
  18. and not (player.pflags & PF_MACESPIN)
  19. and not (player.pflags & PF_STASIS)
  20. and not (player.mo.tracer and player.mo.tracer.type == MT_TUBEWAYPOINT)
  21. //move up if jump is pressed
  22. P_SetObjectMomZ(player.mo, FRACUNIT*8, false)
  23. end
  24.  
  25. if (player.powers[pw_underwater] | player.powers[pw_super]) & swimming == 1
  26. and (player.cmd.buttons & BT_USE)
  27. and not (player.pflags & PF_NIGHTSMODE)
  28. and not (player.pflags & PF_ROPEHANG)
  29. and not (player.pflags & PF_MACESPIN)
  30. and not (player.pflags & PF_STASIS)
  31. and not (player.mo.tracer and player.mo.tracer.type == MT_TUBEWAYPOINT)
  32. // move down if spin is pressed
  33. P_SetObjectMomZ(player.mo, FRACUNIT*-8, false)
  34. end
  35.  
  36. if (player.powers[pw_underwater] | player.powers[pw_super]) & swimming == 1
  37. and not (player.cmd.buttons & (BT_JUMP|BT_USE))
  38. and not (player.pflags & PF_NIGHTSMODE)
  39. and not (player.pflags & PF_ROPEHANG)
  40. and not (player.pflags & PF_MACESPIN)
  41. and not (player.pflags & PF_STASIS)
  42. and not (player.mo.tracer and player.mo.tracer.type == MT_TUBEWAYPOINT)
  43. // kill z momentum when not moving up or down
  44. player.mo.momz = 0
  45. end
  46.  
  47. end, MT_PLAYER)
Advertisement
Add Comment
Please, Sign In to add comment