param for original highlander mode - right now just allows getting another copy of a weapon you already had, but had used that turn.
authornemo
Sat, 29 Mar 2014 13:57:46 -0400
changeset 10219 bbeb1e9aaa65
parent 10218 1d7112ccb3e9
child 10220 05be26df1242
param for original highlander mode - right now just allows getting another copy of a weapon you already had, but had used that turn.
share/hedgewars/Data/Scripts/Multiplayer/Highlander.lua
--- a/share/hedgewars/Data/Scripts/Multiplayer/Highlander.lua	Fri Mar 28 23:04:23 2014 +0400
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Highlander.lua	Sat Mar 29 13:57:46 2014 -0400
@@ -89,6 +89,7 @@
 
 HedgewarsScriptLoad("/Scripts/Locale.lua")
 HedgewarsScriptLoad("/Scripts/Tracker.lua")
+HedgewarsScriptLoad("/Scripts/Params.lua")
 
 -- These define weps allowed by the script. At present Tardis and Resurrection is banned for example
 -- These were arbitrarily defined out-of-order in initial script, so that was preserved here, resulting 
@@ -132,6 +133,13 @@
 
 local someHog = nil -- just for looking up the weps
 
+local mode = nil
+
+function onParameters()
+    parseParams()
+    mode = params["mode"]
+end
+
 function CheckForWeaponSwap()
 	if GetCurAmmoType() ~= lastWep then
 		shotsFired = 0
@@ -212,7 +220,7 @@
 
         for w,c in pairs(wepArray) do
 			val = getGearValue(gear,w)
-			if val ~= 0 and wepArray[w] ~= 9 and getGearValue(CurrentHedgehog, w) == 0  then
+			if val ~= 0 and (mode == "orig" or (wepArray[w] ~= 9 and getGearValue(CurrentHedgehog, w) == 0))  then
 				setGearValue(CurrentHedgehog, w, val)
 
 				-- if you are using multi-shot weapon, gimme one more