Allow user to drop bombs off rope, parachute, and flying saucer.
authormikade
Mon, 15 Aug 2011 17:29:54 +0200
changeset 5571 434ec40070e0
parent 5570 a1eb7555f439
child 5575 41ee1c71deb3
Allow user to drop bombs off rope, parachute, and flying saucer.
share/hedgewars/Data/Scripts/Multiplayer/No_Jumping.lua
--- a/share/hedgewars/Data/Scripts/Multiplayer/No_Jumping.lua	Mon Aug 15 10:16:18 2011 -0400
+++ b/share/hedgewars/Data/Scripts/Multiplayer/No_Jumping.lua	Mon Aug 15 17:29:54 2011 +0200
@@ -4,17 +4,31 @@
 
 loadfile(GetDataPath() .. "Scripts/Locale.lua")()
 
+local specialGear = nil
+
 function onGameInit()
     Goals = loc("Jumping is disabled")
 end
 
---function onGameStart()
---	ShowMission(LOC_NOT("NO JUMPING"), LOC_NOT("- Jumping is disabled"), LOC_NOT("Good luck out there!"), 0, 0)
---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
+