share/hedgewars/Data/Scripts/Multiplayer/No_Jumping.lua
author unc0rr
Tue, 24 Dec 2013 22:16:07 +0400
changeset 9836 00cbbb195f11
parent 8043 da083f8d95e6
permissions -rw-r--r--
Rework of No Gravity script: - Now called Gravity, gravity is derived from get away time percentage in game scheme - Watchdog which sets gravity to normal when TurnTimeLeft is frozen for more than 15 seconds

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