share/hedgewars/Data/Missions/Scenario/User_Mission_-_Teamwork_2.lua
changeset 14466 734a7af2dfc2
parent 14464 ead8928a59f8
child 14482 d4aa64f51c9f
equal deleted inserted replaced
14465:ca851d0957cf 14466:734a7af2dfc2
     7 local hlayer = nil
     7 local hlayer = nil
     8 local enemy = nil
     8 local enemy = nil
     9 local Pack = nil
     9 local Pack = nil
    10 local help = false
    10 local help = false
    11 local GameOver = false
    11 local GameOver = false
    12 local missionWon = false
    12 local playerTeamName = loc("Feeble Resistance")
    13 
    13 
    14 function onGameInit()
    14 function onGameInit()
    15 	Seed = 0
    15 	Seed = 0
    16 	GameFlags = gfDisableWind
    16 	GameFlags = gfDisableWind
    17 	TurnTime = MAX_TURN_TIME
    17 	TurnTime = MAX_TURN_TIME
    24 
    24 
    25 	Explosives = 0
    25 	Explosives = 0
    26 	Map = "CrazyMission"
    26 	Map = "CrazyMission"
    27 	Theme = "CrazyMission"
    27 	Theme = "CrazyMission"
    28 
    28 
    29 	AddTeam(loc("Feeble Resistance"), -1, "Statue", "Island", "Default", "cm_kiwi")
    29 	AddTeam(playerTeamName, -1, "Statue", "Island", "Default", "cm_kiwi")
    30 	player = AddHog(loc("Greg"), 0, 30, "NoHat")
    30 	player = AddHog(loc("Greg"), 0, 30, "NoHat")
    31 	hlayer = AddHog(loc("Mark"), 0, 40, "NoHat")
    31 	hlayer = AddHog(loc("Mark"), 0, 40, "NoHat")
    32 
    32 
    33 	AddTeam(loc("Cybernetic Empire"), -6, "ring", "Island", "Robot", "cm_binary")
    33 	AddTeam(loc("Cybernetic Empire"), -6, "ring", "Island", "Robot", "cm_binary")
    34 	enemy = AddHog(loc("WatchBot 4000"), 5, 50, "cyborg1")
    34 	enemy = AddHog(loc("WatchBot 4000"), 5, 50, "cyborg1")
   104 		ShowMission(loc("Teamwork 2"), loc("MISSION FAILED"), loc("Oh no! Just try again!"), -amSkip, 0)
   104 		ShowMission(loc("Teamwork 2"), loc("MISSION FAILED"), loc("Oh no! Just try again!"), -amSkip, 0)
   105 		GameOver = true
   105 		GameOver = true
   106 		SetHealth(hlayer, 0)
   106 		SetHealth(hlayer, 0)
   107 		SetHealth(player, 0)
   107 		SetHealth(player, 0)
   108 	end
   108 	end
   109 	if (gear == enemy) and (not GameOver) then
   109 end
   110 		GameOver = true
   110 
       
   111 function onGameResult(winningClan)
       
   112 	if winningClan == GetTeamClan(playerTeamName) then
   111 		SaveMissionVar("Won", "true")
   113 		SaveMissionVar("Won", "true")
   112 	end
   114 	end
   113 end
   115 end
   114