share/hedgewars/Data/Scripts/Multiplayer/No_Jumping.lua
author belphegorr <szabibibi@gmail.com>
Mon, 23 Jul 2012 19:15:59 +0300
changeset 7263 644eabbc9218
parent 5827 a416f1070fdf
child 8043 da083f8d95e6
permissions -rw-r--r--
Added a new function: AddNewEvent, which only adds an event to the list if it doesn't already exist. Kept the old one as it might me useful to be able to add an event more than once.
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)
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