share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/death01.lua
branchspacecampaign
changeset 9568 58cdc9332a54
parent 9566 5c50949cfd07
child 9574 da3d39667881
equal deleted inserted replaced
9566:5c50949cfd07 9568:58cdc9332a54
    19 	[dialog01] = {missionName, loc("The final part"), loc("Defeat Professor Hogevil!"), 1, 4500},
    19 	[dialog01] = {missionName, loc("The final part"), loc("Defeat Professor Hogevil!"), 1, 4500},
    20 }
    20 }
    21 -- crates
    21 -- crates
    22 local portalCrate = {x = 1520, y = 1950}
    22 local portalCrate = {x = 1520, y = 1950}
    23 local cakeCrate = {x = 325, y = 1500}
    23 local cakeCrate = {x = 325, y = 1500}
       
    24 local ropeCrate = {x = 1860, y = 500}
       
    25 local pickHammerCrate = {x = 1860, y = 400}
    24 -- hogs
    26 -- hogs
    25 local hero = {}
    27 local hero = {}
    26 local paoth1 = {}
    28 local paoth1 = {}
    27 local paoth2 = {}
    29 local paoth2 = {}
    28 local professor = {}
    30 local professor = {}
    44 hero.y = 845
    46 hero.y = 845
    45 hero.dead = false
    47 hero.dead = false
    46 paoth1.name = "H"
    48 paoth1.name = "H"
    47 paoth1.x = 3730
    49 paoth1.x = 3730
    48 paoth1.y = 1480
    50 paoth1.y = 1480
    49 paoth2.name = "Dr. Cornelius"
    51 paoth2.name = "Dr.Cornelius"
    50 paoth2.x = 3800
    52 paoth2.x = 3800
    51 paoth2.y = 1480
    53 paoth2.y = 1480
    52 professor.name = "Prof. Hogevil"
    54 professor.name = "Prof. Hogevil"
    53 --professor.x = 3630
    55 --professor.x = 3630
    54 --professor.y = 1480
    56 --professor.y = 1480
    76 thug7.y = 1960
    78 thug7.y = 1960
    77 thug7.health = 80
    79 thug7.health = 80
    78 teamA.name = loc("Hog Solo")
    80 teamA.name = loc("Hog Solo")
    79 teamA.color = tonumber("38D61C",16) -- green
    81 teamA.color = tonumber("38D61C",16) -- green
    80 teamB.name = loc("PAotH")
    82 teamB.name = loc("PAotH")
    81 teamB.color = tonumber("FF0000",16) -- red
    83 teamB.color = tonumber("0033FF",16) -- blue because otherwise enemies attack them
    82 teamC.name = loc("Professor")
    84 teamC.name = loc("Professor")
    83 teamC.color = tonumber("0033FF",16) -- blue
    85 teamC.color = tonumber("0033FF",16) -- blue
    84 
    86 
    85 -------------- LuaAPI EVENT HANDLERS ------------------
    87 -------------- LuaAPI EVENT HANDLERS ------------------
    86 
    88 
   101 	AddTeam(teamA.name, teamA.color, "Bone", "Island", "HillBilly", "cm_birdy")
   103 	AddTeam(teamA.name, teamA.color, "Bone", "Island", "HillBilly", "cm_birdy")
   102 	hero.gear = AddHog(hero.name, 0, 100, "war_desertgrenadier1")
   104 	hero.gear = AddHog(hero.name, 0, 100, "war_desertgrenadier1")
   103 	AnimSetGearPosition(hero.gear, hero.x, hero.y)
   105 	AnimSetGearPosition(hero.gear, hero.x, hero.y)
   104 	-- PAotH
   106 	-- PAotH
   105 	AddTeam(teamB.name, teamB.color, "Bone", "Island", "HillBilly", "cm_birdy")
   107 	AddTeam(teamB.name, teamB.color, "Bone", "Island", "HillBilly", "cm_birdy")
   106 	paoth1.gear = AddHog(paoth1.name, 0, 100, "war_desertgrenadier1")
   108 	paoth1.gear = AddHog(paoth1.name, 0, 100, "hair_yellow")
   107 	AnimSetGearPosition(paoth1.gear, paoth1.x, paoth1.y)
   109 	AnimSetGearPosition(paoth1.gear, paoth1.x, paoth1.y)
   108 	HogTurnLeft(paoth1.gear, true)
   110 	HogTurnLeft(paoth1.gear, true)
   109 	paoth2.gear = AddHog(paoth2.name, 0, 100, "war_desertgrenadier1")
   111 	paoth2.gear = AddHog(paoth2.name, 0, 100, "Glasses")
   110 	AnimSetGearPosition(paoth2.gear, paoth2.x, paoth2.y)
   112 	AnimSetGearPosition(paoth2.gear, paoth2.x, paoth2.y)
   111 	HogTurnLeft(paoth2.gear, true)
   113 	HogTurnLeft(paoth2.gear, true)
   112 	-- Professor and Thugs	
   114 	-- Professor and Thugs	
   113 	AddTeam(teamC.name, teamC.color, "Bone", "Island", "HillBilly", "cm_birdy")
   115 	AddTeam(teamC.name, teamC.color, "Bone", "Island", "HillBilly", "cm_birdy")
   114 	professor.human = AddHog(professor.name, 0, 300, "war_desertgrenadier1")
   116 	professor.human = AddHog(professor.name, 0, 300, "tophats")
   115 	AnimSetGearPosition(professor.human, hero.x + 70, hero.y)
   117 	AnimSetGearPosition(professor.human, hero.x + 70, hero.y)
   116 	HogTurnLeft(professor.human, true)
   118 	HogTurnLeft(professor.human, true)
   117 	AddTeam(teamC.name, teamC.color, "Bone", "Island", "HillBilly", "cm_birdy")
   119 	AddTeam(teamC.name, teamC.color, "Bone", "Island", "HillBilly", "cm_birdy")
   118 	professor.bot = AddHog(professor.name, 1, 300, "war_desertgrenadier1")
   120 	professor.bot = AddHog(professor.name, 1, 300, "tophats")
   119 	AnimSetGearPosition(professor.bot, paoth1.x - 100, paoth1.y)
   121 	AnimSetGearPosition(professor.bot, paoth1.x - 100, paoth1.y)
   120 	HogTurnLeft(professor.bot, true)
   122 	HogTurnLeft(professor.bot, true)
   121 	professor.gear = professor.bot
   123 	professor.gear = professor.bot
   122 	for i=1,table.getn(thugs) do
   124 	for i=1,table.getn(thugs) do
   123 		thugs[i].gear = AddHog("thug #"..i, 1, thugs[i].health, "war_desertgrenadier1")
   125 		thugs[i].gear = AddHog("thug #"..i, 1, thugs[i].health, "war_desertgrenadier1")
   137 	AddEvent(onEnemiesDeath, {hero.gear}, enemiesDeath, {hero.gear}, 0)
   139 	AddEvent(onEnemiesDeath, {hero.gear}, enemiesDeath, {hero.gear}, 0)
   138 	
   140 	
   139 	-- add crates
   141 	-- add crates
   140 	SpawnAmmoCrate(portalCrate.x, portalCrate.y, amPortalGun)
   142 	SpawnAmmoCrate(portalCrate.x, portalCrate.y, amPortalGun)
   141 	SpawnAmmoCrate(cakeCrate.x, cakeCrate.y, amCake)
   143 	SpawnAmmoCrate(cakeCrate.x, cakeCrate.y, amCake)
       
   144 	SpawnAmmoCrate(ropeCrate.x, ropeCrate.y, amRope)
       
   145 	SpawnAmmoCrate(pickHammerCrate.x, pickHammerCrate.y, amPickHammer)
   142 	SpawnHealthCrate(cakeCrate.x + 40, cakeCrate.y)
   146 	SpawnHealthCrate(cakeCrate.x + 40, cakeCrate.y)
       
   147 	SpawnHealthCrate(portalCrate.x + 40, portalCrate.y)
   143 	-- add explosives
   148 	-- add explosives
   144 	AddGear(1900, 850, gtExplosives, 0, 0, 0, 0)
   149 	AddGear(1900, 850, gtExplosives, 0, 0, 0, 0)
   145 	AddGear(1900, 800, gtExplosives, 0, 0, 0, 0)
   150 	AddGear(1900, 800, gtExplosives, 0, 0, 0, 0)
   146 	AddGear(1900, 750, gtExplosives, 0, 0, 0, 0)
   151 	AddGear(1900, 750, gtExplosives, 0, 0, 0, 0)
   147 	AddGear(1900, 710, gtExplosives, 0, 0, 0, 0)
   152 	AddGear(1900, 710, gtExplosives, 0, 0, 0, 0)
   168 	AddAmmo(professor.gear, amSwitch, 100)
   173 	AddAmmo(professor.gear, amSwitch, 100)
   169 	AddAmmo(professor.gear, amGrenade, 8)
   174 	AddAmmo(professor.gear, amGrenade, 8)
   170 	AddAmmo(professor.gear, amDEagle, 8)
   175 	AddAmmo(professor.gear, amDEagle, 8)
   171 	
   176 	
   172 	HideHog(professor.bot)
   177 	HideHog(professor.bot)
   173 	--DeleteGear(professor.human)
       
   174 	--RestoreHog(professor.bot)
       
   175 	AddAnim(dialog01)
   178 	AddAnim(dialog01)
   176 	
   179 	
   177 	SendHealthStatsOff()
   180 	SendHealthStatsOff()
   178 end
   181 end
   179 
   182 
   180 function onNewTurn()
   183 function onNewTurn()
   181 	if CurrentHedgehog == paoth1.gear or CurrentHedgehog == paoth2.gear then
   184 	if CurrentHedgehog == paoth1.gear or CurrentHedgehog == paoth2.gear then
       
   185 		AnimSwitchHog(hero.gear)
   182 		TurnTimeLeft = 0
   186 		TurnTimeLeft = 0
   183 	end
   187 	end
   184 end
   188 end
   185 
   189 
   186 function onGameTick()
   190 function onGameTick()
   193 end
   197 end
   194 
   198 
   195 function onAmmoStoreInit()
   199 function onAmmoStoreInit()
   196 	SetAmmo(amCake, 0, 0, 0, 1)
   200 	SetAmmo(amCake, 0, 0, 0, 1)
   197 	SetAmmo(amPortalGun, 0, 0, 0, 1)
   201 	SetAmmo(amPortalGun, 0, 0, 0, 1)
       
   202 	SetAmmo(amRope, 0, 0, 0, 2)
       
   203 	SetAmmo(amPickHammer, 0, 0, 0, 1)
   198 end
   204 end
   199 
   205 
   200 function onGearDelete(gear)
   206 function onGearDelete(gear)
   201 	if gear == hero.gear then
   207 	if gear == hero.gear then
   202 		hero.dead = true
   208 		hero.dead = true