share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/death01.lua
changeset 14489 e5f1431aea1e
parent 14488 7bb7e5e54f70
child 14607 364ab0ae4417
equal deleted inserted replaced
14488:7bb7e5e54f70 14489:e5f1431aea1e
    41 local thugs = { thug1, thug2, thug3, thug4, thug5, thug6, thug7 }
    41 local thugs = { thug1, thug2, thug3, thug4, thug5, thug6, thug7 }
    42 -- teams
    42 -- teams
    43 local teamA = {}
    43 local teamA = {}
    44 local teamB = {}
    44 local teamB = {}
    45 local teamC = {}
    45 local teamC = {}
       
    46 local teamD = {}
    46 -- hedgehogs values
    47 -- hedgehogs values
    47 hero.name = loc("Hog Solo")
    48 hero.name = loc("Hog Solo")
    48 hero.x = 520
    49 hero.x = 520
    49 hero.y = 845
    50 hero.y = 845
    50 hero.dead = false
    51 hero.dead = false
    80 thug7.health = 80
    81 thug7.health = 80
    81 teamA.name = loc("Hog Solo")
    82 teamA.name = loc("Hog Solo")
    82 teamA.color = -6
    83 teamA.color = -6
    83 teamB.name = loc("PAotH")
    84 teamB.name = loc("PAotH")
    84 teamB.color = teamA.color
    85 teamB.color = teamA.color
    85 teamC.name = loc("Professor")
    86 teamC.name = loc("Professor's Team")
    86 teamC.color = -2
    87 teamC.color = -2
       
    88 teamD.name = loc("Professor")
       
    89 teamD.color = -2
    87 
    90 
    88 -------------- LuaAPI EVENT HANDLERS ------------------
    91 -------------- LuaAPI EVENT HANDLERS ------------------
    89 
    92 
    90 function onGameInit()
    93 function onGameInit()
    91 	Seed = 1
    94 	Seed = 1
   107 	teamA.name = AddMissionTeam(teamA.color)
   110 	teamA.name = AddMissionTeam(teamA.color)
   108 	hero.gear = AddMissionHog(100)
   111 	hero.gear = AddMissionHog(100)
   109 	hero.name = GetHogName(hero.gear)
   112 	hero.name = GetHogName(hero.gear)
   110 	AnimSetGearPosition(hero.gear, hero.x, hero.y)
   113 	AnimSetGearPosition(hero.gear, hero.x, hero.y)
   111 
   114 
   112 	-- PAotH
   115 	-- PAotH (passive team)
   113 	teamB.name = AddTeam(teamB.name, teamB.color, "Earth", "Island", "Default", "cm_galaxy")
   116 	teamB.name = AddTeam(teamB.name, teamB.color, "Earth", "Island", "Default", "cm_galaxy")
   114 	paoth1.gear = AddHog(paoth1.name, 0, 100, "hair_yellow")
   117 	paoth1.gear = AddHog(paoth1.name, 0, 100, "hair_yellow")
   115 	AnimSetGearPosition(paoth1.gear, paoth1.x, paoth1.y)
   118 	AnimSetGearPosition(paoth1.gear, paoth1.x, paoth1.y)
   116 	HogTurnLeft(paoth1.gear, true)
   119 	HogTurnLeft(paoth1.gear, true)
   117 	SetGearAIHints(paoth1.gear, aihDoesntMatter)
   120 	SetGearAIHints(paoth1.gear, aihDoesntMatter)
   118 	paoth2.gear = AddHog(paoth2.name, 0, 100, "Glasses")
   121 	paoth2.gear = AddHog(paoth2.name, 0, 100, "Glasses")
   119 	AnimSetGearPosition(paoth2.gear, paoth2.x, paoth2.y)
   122 	AnimSetGearPosition(paoth2.gear, paoth2.x, paoth2.y)
   120 	HogTurnLeft(paoth2.gear, true)
   123 	HogTurnLeft(paoth2.gear, true)
   121 	SetGearAIHints(paoth2.gear, aihDoesntMatter)
   124 	SetGearAIHints(paoth2.gear, aihDoesntMatter)
   122 
   125 
   123 	-- Professor and Thugs
   126 	-- Professor's Team (computer enemy)
   124 	teamC.name = AddTeam(teamC.name, teamC.color, "eyecross", "Island", "Default", "cm_sine")
   127 	teamC.name = AddTeam(teamC.name, teamC.color, "eyecross", "Island", "Default", "cm_sine")
   125 	professor.bot = AddHog(professor.name, 1, 300, "tophats")
   128 	professor.bot = AddHog(professor.name, 1, 300, "tophats")
   126 	AnimSetGearPosition(professor.bot, paoth1.x - 100, paoth1.y)
   129 	AnimSetGearPosition(professor.bot, paoth1.x - 100, paoth1.y)
   127 	HogTurnLeft(professor.bot, true)
   130 	HogTurnLeft(professor.bot, true)
   128 	professor.gear = professor.bot
   131 	professor.gear = professor.bot
   130 		thugs[i].gear = AddHog(string.format(loc("Thug #%d"), i), 1, thugs[i].health, "war_desertgrenadier1")
   133 		thugs[i].gear = AddHog(string.format(loc("Thug #%d"), i), 1, thugs[i].health, "war_desertgrenadier1")
   131 		AnimSetGearPosition(thugs[i].gear, thugs[i].x, thugs[i].y)
   134 		AnimSetGearPosition(thugs[i].gear, thugs[i].x, thugs[i].y)
   132 		HogTurnLeft(thugs[i].gear, not thugs[i].turnLeft)
   135 		HogTurnLeft(thugs[i].gear, not thugs[i].turnLeft)
   133 	end
   136 	end
   134 
   137 
   135 	teamC.name = AddTeam(teamC.name, teamC.color, "star", "Island", "Default", "cm_sine")
   138 	-- Professor (special team for cut sequence only)
       
   139 	teamD.name = AddTeam(teamD.name, teamD.color, "star", "Island", "Default", "cm_sine")
   136 	professor.human = AddHog(professor.name, 0, 300, "tophats")
   140 	professor.human = AddHog(professor.name, 0, 300, "tophats")
       
   141 	-- hog will be removed and replaced by professor.bot after cut sequence
   137 	AnimSetGearPosition(professor.human, hero.x + 70, hero.y)
   142 	AnimSetGearPosition(professor.human, hero.x + 70, hero.y)
   138 	HogTurnLeft(professor.human, true)
   143 	HogTurnLeft(professor.human, true)
   139 
   144 
   140 	initCheckpoint("death01")
   145 	initCheckpoint("death01")
   141 
   146