share/hedgewars/Data/Scripts/Multiplayer/No_Jumping.lua
author Wuzzy <almikes@aol.com>
Wed, 13 Apr 2016 01:28:20 +0200
changeset 11722 fc4909039db8
parent 8043 da083f8d95e6
permissions -rw-r--r--
Construction Mode: “spawn” extra time, not buying
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
8043
da083f8d95e6 We need custom script loading function in lua now
unc0rr
parents: 5827
diff changeset
     5
HedgewarsScriptLoad("/Scripts/Locale.lua")
4662
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)
5827
a416f1070fdf we don't need trailing whitespaces... I guess :P
sheepluva
parents: 5571
diff changeset
    18
5571
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