share/hedgewars/Data/Scripts/Multiplayer/No_Jumping.lua
author mikade <redgrinner@gmail.com>
Wed, 27 May 2015 22:34:11 +0900
changeset 10967 1434cec96ca3
parent 8043 da083f8d95e6
permissions -rw-r--r--
- preview generation for rubbers, air-mines, crates, barrels - add map previews for the other 6 TechRacer maps - make TechRacer (more or less) work out the box - randomize map by clicking on preview (when map unspecified)

--------------------------------
-- 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