- don't give hogs air weps when border is enabled
authormikade <redgrinner@gmail.com>
Sun, 25 Mar 2012 17:37:07 +0200
changeset 6820 7db9e89b3f80
parent 6819 07e8de67c3c2
child 6821 d4f75843cf5d
- don't give hogs air weps when border is enabled - add missing napalm - small code restructures
share/hedgewars/Data/Scripts/Multiplayer/Highlander.lua
--- a/share/hedgewars/Data/Scripts/Multiplayer/Highlander.lua	Sun Mar 25 17:34:40 2012 +0200
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Highlander.lua	Sun Mar 25 17:37:07 2012 +0200
@@ -1,6 +1,6 @@
 --------------------------------
 -- HIGHLANDER / HOGS OF WAR
--- version 0.3b
+-- version 0.3c
 -- by mikade
 --------------------------------
 
@@ -43,12 +43,39 @@
 -- hammer wep removed
 -- all hogs have kamikaze
 
+-----------
+--0.3c
+-----------
+
+-- restructured some code
+-- added napalm (whoops) to list of possible weapons you can get
+-- hogs no longer recieve airstrike-related weps on border maps
+
 loadfile(GetDataPath() .. "Scripts/Locale.lua")()
 loadfile(GetDataPath() .. "Scripts/Tracker.lua")()
 
-local wepArray = {}
-local atkArray = {}
-local utilArray = {}
+local airWeapons = 	{amAirAttack, amMineStrike, amNapalm, amDrillStrike --[[,amPiano]]}
+
+local atkArray = 	{
+					amBazooka, amBee, amMortar, amDrill, --[[amSnowball,]]
+					amGrenade, amClusterBomb, amMolotov, amWatermelon, amHellishBomb, amGasBomb,
+					amShotgun, amDEagle, amFlamethrower, amSniperRifle, amSineGun,
+					amFirePunch, amWhip, amBaseballBat, --[[amKamikaze,]] amSeduction, --[[amHammer,]]
+					amMine, amDynamite, amCake, amBallgun, amRCPlane, amSMine,
+					amRCPlane, amSMine,
+					amBirdy
+					}
+
+local utilArray = 	{
+					amBlowTorch, amPickHammer, amGirder, amPortalGun,
+					amRope, amParachute, amTeleport, amJetpack,
+					amInvulnerable, amLaserSight, --[[amVampiric,]]
+					amLowGravity, amExtraDamage, --[[amExtraTime,]]
+					amLandGun
+					--[[,amTardis, amResurrector, amSwitch]]
+					}
+
+local wepArray = 	{}
 
 local currName
 local lastName
@@ -57,7 +84,7 @@
 
 function StartingSetUp(gear)
 
-	for i = 1, #wepArray do	
+	for i = 1, #wepArray do
 		setGearValue(gear,wepArray[i],0)
 	end
 
@@ -85,7 +112,7 @@
 
 function ConvertValues(gear)
 
-	for i = 1, #wepArray do	
+	for i = 1, #wepArray do
 		AddAmmo(gear, wepArray[i], getGearValue(gear,wepArray[i]) )
 	end
 
@@ -97,7 +124,7 @@
 
 	if CurrentHedgehog ~= nil then
 
-		for i = 1, #wepArray do		
+		for i = 1, #wepArray do
 			val = getGearValue(gear,wepArray[i])
 			if val ~= 0 then
 				setGearValue(CurrentHedgehog, wepArray[i], val)
@@ -109,8 +136,6 @@
 
 end
 
-
-
 function onGameInit()
 	GameFlags = gfInfAttack + gfRandomOrder
 	HealthCaseProb = 100
@@ -130,41 +155,19 @@
 				"", 4, 4000
 				)
 
-	atkArray = 	{amBazooka, amBee, amMortar, amDrill, --[[amSnowball,]]
-			amGrenade, amClusterBomb, amMolotov, amWatermelon, amHellishBomb, amGasBomb,
-			amShotgun, amDEagle, amFlamethrower, amSniperRifle, amSineGun,
-			amFirePunch, amWhip, amBaseballBat, --[[amKamikaze,]] amSeduction, --[[amHammer,]]
-			amMine, amDynamite, amCake, amBallgun, amRCPlane, amSMine,
-			amAirAttack, amMineStrike, amDrillStrike, --[[amPiano,]] amRCPlane, amSMine,
-			amBirdy
-
-			} 
-
-	utilArray = 	{amBlowTorch, amPickHammer, amGirder, amPortalGun,
-			amRope, amParachute, amTeleport, amJetpack,
-			amInvulnerable, amLaserSight, --[[amVampiric,]]
-			amLowGravity, amExtraDamage, --[[amExtraTime,]]
-			amLandGun
-			}
+	if MapHasBorder() == false then
+        for i, w in pairs(airWeapons) do
+            table.insert(atkArray, w)
+        end
+    end
 
-	wepArray = 	{amBazooka, amBee, amMortar, amDrill, --[[amSnowball,]]
-			amGrenade, amClusterBomb, amMolotov, amWatermelon, amHellishBomb, amGasBomb,
-			amShotgun, amDEagle, amFlamethrower, amSniperRifle, amSineGun,
-			amFirePunch, amWhip, amBaseballBat, --[[amKamikaze,]] amSeduction, --[[amHammer,]]
-			amMine, amDynamite, amCake, amBallgun, amRCPlane, amSMine,
-			amAirAttack, amMineStrike, amDrillStrike, --[[amPiano,]] amRCPlane, amSMine,
-			amBirdy,
-			
-			amBlowTorch, amPickHammer, amGirder, amPortalGun,
-			amRope, amParachute, amTeleport, amJetpack,
-			amInvulnerable, amLaserSight, --[[amVampiric,]]
-			amLowGravity, amExtraDamage, --[[amExtraTime,]]
-			amLandGun
+	for i, w in pairs(atkArray) do
+        table.insert(wepArray, w)
+	end
 
-			}
-
-	-- REMOVED
-	-- amTardis, amResurrector, amSwitch 
+	for i, w in pairs(utilArray) do
+        table.insert(wepArray, w)
+	end
 
 	runOnGears(StartingSetUp)
 	runOnGears(ConvertValues)