share/hedgewars/Data/Scripts/Multiplayer/No_Jumping.lua
author spudpiggy <facetakers@gmail.com>
Fri, 05 Apr 2024 13:10:55 +0100
changeset 16006 1f9f971adec4
parent 8043 da083f8d95e6
permissions -rw-r--r--
sndCover now falls back to sndWatchThis OR sndFire. sndDrat and sndBugger now fall back to each other.

--------------------------------
-- NO JUMPING
--------------------------------

HedgewarsScriptLoad("/Scripts/Locale.lua")

local specialGear = nil

function onGameInit()
    Goals = loc("Jumping is disabled")
end

function onNewTurn()
	SetInputMask(band(0xFFFFFFFF, bnot(gmLJump + gmHJump)))
end

function onGearAdd(gear)

	if (GetGearType(gear) == gtJetpack) or (GetGearType(gear) == gtRope) or (GetGearType(gear) == gtParachute) then
		specialGear = gear
		SetInputMask(band(0xFFFFFFFF, bnot(gmHJump)))
	end

end

function onGearDelete(gear)

	if (GetGearType(gear) == gtJetpack) or (GetGearType(gear) == gtRope) or (GetGearType(gear) == gtParachute) then
		specialGear = nil
		SetInputMask(band(0xFFFFFFFF, bnot(gmLJump + gmHJump)))
	end

end