share/hedgewars/Data/Missions/Scenario/User_Mission_-_Spooky_Tree.lua
changeset 15091 5c8c729a16ce
parent 15015 a1165392c9db
equal deleted inserted replaced
15090:33eca3f0a9aa 15091:5c8c729a16ce
     1 
     1 
     2 HedgewarsScriptLoad("/Scripts/Locale.lua")
     2 HedgewarsScriptLoad("/Scripts/Locale.lua")
     3 
     3 
     4 ---------------------------------------------------------------
     4 ---------------------------------------------------------------
     5 
     5 
       
     6 local playerTeamName
     6 local player = nil -- This variable will point to the hog's gear
     7 local player = nil -- This variable will point to the hog's gear
     7 local instructor = nil
     8 local instructor = nil
     8 local enemy = nil
     9 local enemy = nil
     9 
    10 
    10 local GameOver = false
    11 local GameOver = false
    27 	Theme = "Halloween" -- The theme to be used
    28 	Theme = "Halloween" -- The theme to be used
    28 	-- Disable Sudden Death
    29 	-- Disable Sudden Death
    29 	HealthDecrease = 0
    30 	HealthDecrease = 0
    30 	WaterRise = 0
    31 	WaterRise = 0
    31 
    32 
    32 	AddMissionTeam(-1)
    33 	playerTeamName = AddMissionTeam(-1)
    33 	player = AddMissionHog(1)
    34 	player = AddMissionHog(1)
    34 	AddTeam(loc("Toxic Team"), -6, "skull", "Island", "Default_qau", "cm_magicskull")
    35 	AddTeam(loc("Toxic Team"), -6, "skull", "Island", "Default_qau", "cm_magicskull")
    35 	enemy = AddHog(loc("Poison"), 1, 10, "Skull")
    36 	enemy = AddHog(loc("Poison"), 1, 10, "Skull")
    36 
    37 
    37 	SetGearPosition(player,970,23)
    38 	SetGearPosition(player,970,23)
   114 		SetHealth(player, 0)
   115 		SetHealth(player, 0)
   115 		GameOver = true
   116 		GameOver = true
   116 	end
   117 	end
   117 
   118 
   118 	if TurnTimeLeft == 1 then
   119 	if TurnTimeLeft == 1 then
   119 		--ShowMission(loc(caption), loc(subcaption), loc(timeout), -amSkip, 0);
       
   120 		SetHealth(player, 0)
   120 		SetHealth(player, 0)
   121 		GameOver = true
   121 		GameOver = true
   122 	end
   122 	end
   123 
   123 
   124 end
   124 end
   147 	end
   147 	end
   148 
   148 
   149 end
   149 end
   150 
   150 
   151 function onGameResult(winner)
   151 function onGameResult(winner)
   152 	if winner == 0 then
   152 	if winner == GetTeamClan(playerTeamName) then
   153 		ShowMission(loc("Spooky Tree"), loc("MISSION SUCCESSFUL"), loc("Congratulations!"), 0, 0);
       
   154 		SaveMissionVar("Won", "true")
   153 		SaveMissionVar("Won", "true")
       
   154 		SendStat(siGameResult, loc("Mission succeeded!"))
   155 		GameOver = true
   155 		GameOver = true
   156 	else
   156 	else
   157 		ShowMission(loc("Spooky Tree"), loc("MISSION FAILED"), loc("Oh no! Just try again!"), -amSkip, 0)
   157 		SendStat(siGameResult, loc("Mission failed!"))
   158 		GameOver = true
   158 		GameOver = true
   159 	end
   159 	end
   160 end
   160 end