share/hedgewars/Data/Scripts/Multiplayer/No_Jumping.lua
author Wuzzy <Wuzzy2@mail.ru>
Mon, 12 Mar 2018 19:39:00 +0100
changeset 13173 4d1cf0d76eb7
parent 8043 da083f8d95e6
permissions -rw-r--r--
Remove rubber duck from BRW, RW and most weapon schemes for now The duck is not liked by players. Rubber duck needs a lot of rework. Before that happens, better remove it from game modes for now. Players can always modify the weapon schemes, of course.

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