share/hedgewars/Data/Scripts/Multiplayer/No_Jumping.lua
author mikade
Mon, 15 Aug 2011 17:29:54 +0200
changeset 5571 434ec40070e0
parent 5325 261b79ba22b1
child 5827 a416f1070fdf
permissions -rw-r--r--
Allow user to drop bombs off rope, parachute, and flying saucer.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
     1
--------------------------------
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
     2
-- NO JUMPING
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
     3
--------------------------------
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
     4
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
     5
loadfile(GetDataPath() .. "Scripts/Locale.lua")()
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
     6
5571
434ec40070e0 Allow user to drop bombs off rope, parachute, and flying saucer.
mikade
parents: 5325
diff changeset
     7
local specialGear = nil
434ec40070e0 Allow user to drop bombs off rope, parachute, and flying saucer.
mikade
parents: 5325
diff changeset
     8
4893
353781305c07 make Random Weapons and No Jumping use the new custom goal function
Henek
parents: 4662
diff changeset
     9
function onGameInit()
353781305c07 make Random Weapons and No Jumping use the new custom goal function
Henek
parents: 4662
diff changeset
    10
    Goals = loc("Jumping is disabled")
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    11
end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    12
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    13
function onNewTurn()
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    14
	SetInputMask(band(0xFFFFFFFF, bnot(gmLJump + gmHJump)))
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    15
end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    16
5571
434ec40070e0 Allow user to drop bombs off rope, parachute, and flying saucer.
mikade
parents: 5325
diff changeset
    17
function onGearAdd(gear)
434ec40070e0 Allow user to drop bombs off rope, parachute, and flying saucer.
mikade
parents: 5325
diff changeset
    18
	
434ec40070e0 Allow user to drop bombs off rope, parachute, and flying saucer.
mikade
parents: 5325
diff changeset
    19
	if (GetGearType(gear) == gtJetpack) or (GetGearType(gear) == gtRope) or (GetGearType(gear) == gtParachute) then
434ec40070e0 Allow user to drop bombs off rope, parachute, and flying saucer.
mikade
parents: 5325
diff changeset
    20
		specialGear = gear
434ec40070e0 Allow user to drop bombs off rope, parachute, and flying saucer.
mikade
parents: 5325
diff changeset
    21
		SetInputMask(band(0xFFFFFFFF, bnot(gmHJump)))
434ec40070e0 Allow user to drop bombs off rope, parachute, and flying saucer.
mikade
parents: 5325
diff changeset
    22
	end
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    23
5571
434ec40070e0 Allow user to drop bombs off rope, parachute, and flying saucer.
mikade
parents: 5325
diff changeset
    24
end
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    25
5571
434ec40070e0 Allow user to drop bombs off rope, parachute, and flying saucer.
mikade
parents: 5325
diff changeset
    26
function onGearDelete(gear)
434ec40070e0 Allow user to drop bombs off rope, parachute, and flying saucer.
mikade
parents: 5325
diff changeset
    27
434ec40070e0 Allow user to drop bombs off rope, parachute, and flying saucer.
mikade
parents: 5325
diff changeset
    28
	if (GetGearType(gear) == gtJetpack) or (GetGearType(gear) == gtRope) or (GetGearType(gear) == gtParachute) then
434ec40070e0 Allow user to drop bombs off rope, parachute, and flying saucer.
mikade
parents: 5325
diff changeset
    29
		specialGear = nil
434ec40070e0 Allow user to drop bombs off rope, parachute, and flying saucer.
mikade
parents: 5325
diff changeset
    30
		SetInputMask(band(0xFFFFFFFF, bnot(gmLJump + gmHJump)))
434ec40070e0 Allow user to drop bombs off rope, parachute, and flying saucer.
mikade
parents: 5325
diff changeset
    31
	end
434ec40070e0 Allow user to drop bombs off rope, parachute, and flying saucer.
mikade
parents: 5325
diff changeset
    32
434ec40070e0 Allow user to drop bombs off rope, parachute, and flying saucer.
mikade
parents: 5325
diff changeset
    33
end
434ec40070e0 Allow user to drop bombs off rope, parachute, and flying saucer.
mikade
parents: 5325
diff changeset
    34