Portal mission: Don't allow enemies to walk
authorWuzzy <Wuzzy2@mail.ru>
Mon, 21 Jan 2019 20:06:25 +0100
changeset 14656 7dbf528ed6a0
parent 14655 5931aff25837
child 14657 919754e1c269
Portal mission: Don't allow enemies to walk
share/hedgewars/Data/Missions/Scenario/portal.lua
--- a/share/hedgewars/Data/Missions/Scenario/portal.lua	Mon Jan 21 19:56:43 2019 +0100
+++ b/share/hedgewars/Data/Missions/Scenario/portal.lua	Mon Jan 21 20:06:25 2019 +0100
@@ -2,7 +2,7 @@
 HedgewarsScriptLoad("/Scripts/Utils.lua")
 
 local MineArray = {}
-local player
+local player, playerTeamName
 local adviceGiven0 = false
 local adviceGiven1 = false
 local adviceGiven2 = false
@@ -20,7 +20,7 @@
 	HealthDecrease = 0
 	WaterRise = 0
 
-	AddMissionTeam(-1)
+	playerTeamName = AddMissionTeam(-1)
 	player = AddMissionHog(10)
 
 	AddTeam(loc("Hell Army"), -9, "skull", "Island", "Default", "cm_hellish")
@@ -83,6 +83,12 @@
 
 end
 
+function onGearAdd(gear)
+	if (GetGearType(gear) == gtHedgehog) and (GetHogTeamName(gear) ~= playerTeamName) then
+		SetEffect(gear, heArtillery, 1)
+	end
+end
+
 function onGameStart()
 
 	SetWind(100)