share/hedgewars/Data/Scripts/Multiplayer/No_Jumping.lua
author Wuzzy <Wuzzy2@mail.ru>
Tue, 28 May 2019 00:48:17 +0200
changeset 15068 6f51c75994a4
parent 8043 da083f8d95e6
permissions -rw-r--r--
Semi-standardize usage of icons in many mission panels * Question mark: Decision / user input * Exclamation mark: Tutorial message / information * Hedgehog: Mission introduction * -amSkip: Mission failure * Star: Mission success / end of game

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