share/hedgewars/Data/Missions/Scenario/User_Mission_-_Teamwork.lua
changeset 14466 734a7af2dfc2
parent 14464 ead8928a59f8
child 14482 d4aa64f51c9f
equal deleted inserted replaced
14465:ca851d0957cf 14466:734a7af2dfc2
     2 
     2 
     3 local player = nil -- This variable will point to the hog's gear
     3 local player = nil -- This variable will point to the hog's gear
     4 local p2 = nil
     4 local p2 = nil
     5 local enemy = nil
     5 local enemy = nil
     6 local bCrate = nil
     6 local bCrate = nil
       
     7 local playerTeamName = loc("Feeble Resistance")
     7 
     8 
     8 local GameOver = false
     9 local GameOver = false
     9 
    10 
    10 function onGameInit()
    11 function onGameInit()
    11 
    12 
    21 	Theme = "Nature" -- The theme to be used
    22 	Theme = "Nature" -- The theme to be used
    22 	-- Disable Sudden Death
    23 	-- Disable Sudden Death
    23 	HealthDecrease = 0
    24 	HealthDecrease = 0
    24 	WaterRise = 0
    25 	WaterRise = 0
    25 
    26 
    26 	AddTeam(loc("Feeble Resistance"), -1, "Statue", "Island", "Default", "cm_kiwi")
    27 	AddTeam(playerTeamName, -1, "Statue", "Island", "Default", "cm_kiwi")
    27 	player = AddHog(loc("Greg"), 0, 50, "NoHat")
    28 	player = AddHog(loc("Greg"), 0, 50, "NoHat")
    28 	p2 = AddHog(loc("Mark"), 0, 20, "NoHat")
    29 	p2 = AddHog(loc("Mark"), 0, 20, "NoHat")
    29 
    30 
    30 	AddTeam(loc("Cybernetic Empire"), -6, "ring", "Island", "Robot", "cm_cyborg")
    31 	AddTeam(loc("Cybernetic Empire"), -6, "ring", "Island", "Robot", "cm_cyborg")
    31 	enemy = AddHog(loc("Unit 3378"), 5, 30, "cyborg1")
    32 	enemy = AddHog(loc("Unit 3378"), 5, 30, "cyborg1")
    96 		ShowMission(loc("Teamwork"), loc("MISSION FAILED"), loc("Oh no! Just try again!"), -amSkip, 0)
    97 		ShowMission(loc("Teamwork"), loc("MISSION FAILED"), loc("Oh no! Just try again!"), -amSkip, 0)
    97 		GameOver = true
    98 		GameOver = true
    98 		SetHealth(p2,0)
    99 		SetHealth(p2,0)
    99 		SetHealth(player,0)
   100 		SetHealth(player,0)
   100 	end
   101 	end
   101 	if (gear == enemy) and not (GameOver) then
       
   102 		SaveMissionVar("Won", "true")
       
   103 		GameOver = true
       
   104 	end
       
   105 
   102 
   106 end
   103 end
   107 
   104 
       
   105 function onGameResult(winningClan)
       
   106 	if winningClan == GetTeamClan(playerTeamName) then
       
   107 		SaveMissionVar("Won", "true")
       
   108 	end
       
   109 end