View difference between Paste ID: 2uZLh7T4 and LyFyqUdy
SHOW: | | - or go back to the newest paste.
1
addHook("MobjThinker", function(mobj)
2-
	local player = mobj.player
2+
        local player = mobj.player
3-
	local swimming = 0
3+
        local swimming = 0
4-
4+
 
5-
		if swimming == 0 & (player.pflags & PF_JUMPED) & (player.cmd.buttons & BT_USE)
5+
                if swimming == 0 and (player.cmd.buttons & BT_CUSTOM1)
6-
			swimming = 1
6+
                	   swimming = 1
7-
			end
7+
                        end
8-
8+
			if swimming == 1 and (player.cmd.buttons & BT_CUSTOM2)
9-
		if not player.powers[pw_underwater]
9+
				   swimming = 0	
10-
			and not player.powers[pw_super]
10+
 				   end
11-
			swimming = 0
11+
                if not player.powers[pw_underwater]
12-
			end
12+
                        and not player.powers[pw_super]
13-
13+
                        swimming = 0
14-
		if (player.powers[pw_underwater] | player.powers[pw_super]) & swimming == 1
14+
                        end
15-
		and (player.cmd.buttons & BT_JUMP)
15+
		if (player.powers[pw_underwater] | player.powers[pw_super]) and swimming == 1
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
21+
				if (player.cmd.buttons & BT_JUMP)
22-
				P_SetObjectMomZ(player.mo, FRACUNIT*8, false)
22+
					//move up if jump is pressed
23-
			end
23+
					P_SetObjectMomZ(player.mo, FRACUNIT*8, false)
24-
24+
				end
25-
		if (player.powers[pw_underwater] | player.powers[pw_super]) & swimming == 1
25+
				if (player.cmd.buttons & BT_USE)
26-
		and (player.cmd.buttons & BT_USE)
26+
					// move down if spin is pressed
27
					P_SetObjectMomZ(player.mo, FRACUNIT*-8, false)
28
				end
29
				if not (player.cmd.buttons & (BT_JUMP|BT_USE))
30
					// kill z momentum when not moving up or down
31
					player.mo.momz = 0
32-
				// move down if spin is pressed
32+
				end
33-
				P_SetObjectMomZ(player.mo, FRACUNIT*-8, false)
33+
		end
34-
			end
34+