Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- addHook("MobjThinker", function(mobj)
- local player = mobj.player
- local swimming = 0
- if swimming == 0 & (player.pflags & PF_JUMPED) & (player.cmd.buttons & BT_USE)
- swimming = 1
- end
- if not player.powers[pw_underwater]
- and not player.powers[pw_super]
- swimming = 0
- end
- if (player.powers[pw_underwater] | player.powers[pw_super]) & swimming == 1
- and (player.cmd.buttons & BT_JUMP)
- and not (player.pflags & PF_NIGHTSMODE)
- and not (player.pflags & PF_ROPEHANG)
- and not (player.pflags & PF_MACESPIN)
- and not (player.pflags & PF_STASIS)
- and not (player.mo.tracer and player.mo.tracer.type == MT_TUBEWAYPOINT)
- //move up if jump is pressed
- P_SetObjectMomZ(player.mo, FRACUNIT*8, false)
- end
- if (player.powers[pw_underwater] | player.powers[pw_super]) & swimming == 1
- and (player.cmd.buttons & BT_USE)
- and not (player.pflags & PF_NIGHTSMODE)
- and not (player.pflags & PF_ROPEHANG)
- and not (player.pflags & PF_MACESPIN)
- and not (player.pflags & PF_STASIS)
- and not (player.mo.tracer and player.mo.tracer.type == MT_TUBEWAYPOINT)
- // move down if spin is pressed
- P_SetObjectMomZ(player.mo, FRACUNIT*-8, false)
- end
- if (player.powers[pw_underwater] | player.powers[pw_super]) & swimming == 1
- and not (player.cmd.buttons & (BT_JUMP|BT_USE))
- and not (player.pflags & PF_NIGHTSMODE)
- and not (player.pflags & PF_ROPEHANG)
- and not (player.pflags & PF_MACESPIN)
- and not (player.pflags & PF_STASIS)
- and not (player.mo.tracer and player.mo.tracer.type == MT_TUBEWAYPOINT)
- // kill z momentum when not moving up or down
- player.mo.momz = 0
- end
- end, MT_PLAYER)
Advertisement
Add Comment
Please, Sign In to add comment