addHook("PlayerThink", function(p)
	if p.mo.skin == "sonic"
	and (p.pflags & PF_JUMPED)
	and (p.cmd.buttons & BT_CUSTOM3)
	and not p.momentumthokus == true
		P_Thrust(p.mo, p.mo.angle, 50*FRACUNIT)
		P_SpawnThokMobj(p)
		S_StartSound(p.mo, sfx_thok)
		p.momentumthokus = true
		p.isinboostmode = true
	end
end)

addHook("PlayerThink", function(p)
	if p.mo.skin == "sonic"
	and P_IsObjectOnGround(p.mo)
		p.momentumthokus = false
	end
end)