share/hedgewars/Data/Scripts/Multiplayer/No_Jumping.lua
author mikade
Sun, 11 Sep 2011 04:08:50 +0200
changeset 5845 b20a1e0a0e7e
parent 5827 a416f1070fdf
child 8043 da083f8d95e6
permissions -rw-r--r--
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer. More changes/updates on this script to come.

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

loadfile(GetDataPath() .. "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