Simplify turn handling in ASA death01
authorWuzzy <Wuzzy2@mail.ru>
Wed, 11 Jul 2018 18:59:23 +0200
changeset 13474 7a63e0a2d2ca
parent 13473 bc5a086a91dc
child 13475 2a0df4705849
Simplify turn handling in ASA death01
share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/death01.lua
--- a/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/death01.lua	Wed Jul 11 18:45:54 2018 +0200
+++ b/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/death01.lua	Wed Jul 11 18:59:23 2018 +0200
@@ -96,6 +96,8 @@
 	Explosives = 2
 	Delay = 3
 	HealthCaseAmount = 50
+	-- gfTagTeam makes it easier to skip the PAotH team
+	GameFlags = gfTagTeam
 	-- Disable Sudden Death
 	HealthDecrease = 0
 	WaterRise = 0
@@ -107,6 +109,17 @@
 	hero.gear = AddHog(hero.name, 0, 100, "war_desertgrenadier1")
 	AnimSetGearPosition(hero.gear, hero.x, hero.y)
 
+	-- PAotH
+	AddTeam(teamB.name, teamB.color, "Earth", "Island", "Default", "cm_galaxy")
+	paoth1.gear = AddHog(paoth1.name, 0, 100, "hair_yellow")
+	AnimSetGearPosition(paoth1.gear, paoth1.x, paoth1.y)
+	HogTurnLeft(paoth1.gear, true)
+	SetGearAIHints(paoth1.gear, aihDoesntMatter)
+	paoth2.gear = AddHog(paoth2.name, 0, 100, "Glasses")
+	AnimSetGearPosition(paoth2.gear, paoth2.x, paoth2.y)
+	HogTurnLeft(paoth2.gear, true)
+	SetGearAIHints(paoth2.gear, aihDoesntMatter)
+
 	-- Professor and Thugs
 	AddTeam(teamC.name, teamC.color, "eyecross", "Island", "Default", "cm_sine")
 	professor.bot = AddHog(professor.name, 1, 300, "tophats")
@@ -124,17 +137,6 @@
 	AnimSetGearPosition(professor.human, hero.x + 70, hero.y)
 	HogTurnLeft(professor.human, true)
 
-	-- PAotH
-	AddTeam(teamB.name, teamB.color, "Earth", "Island", "Default", "cm_galaxy")
-	paoth1.gear = AddHog(paoth1.name, 0, 100, "hair_yellow")
-	AnimSetGearPosition(paoth1.gear, paoth1.x, paoth1.y)
-	HogTurnLeft(paoth1.gear, true)
-	SetGearAIHints(paoth1.gear, aihDoesntMatter)
-	paoth2.gear = AddHog(paoth2.name, 0, 100, "Glasses")
-	AnimSetGearPosition(paoth2.gear, paoth2.x, paoth2.y)
-	HogTurnLeft(paoth2.gear, true)
-	SetGearAIHints(paoth2.gear, aihDoesntMatter)
-
 	initCheckpoint("death01")
 
 	AnimInit(true)
@@ -205,10 +207,8 @@
 end
 
 function onNewTurn()
+	-- Team PAotH is passive and does not play
 	if CurrentHedgehog == paoth1.gear or CurrentHedgehog == paoth2.gear then
-		if professor.gear and GetHealth(professor.gear) then
-			AnimSwitchHog(professor.gear)
-		end
 		EndTurn(true)
 	end
 end