share/hedgewars/Data/Missions/Scenario/User_Mission_-_Dangerous_Ducklings.lua
author Wuzzy <Wuzzy2@mail.ru>
Fri, 11 Oct 2019 18:59:48 +0200
changeset 15473 b56c04fac6f9
parent 15096 5c8c729a16ce
permissions -rw-r--r--
Fix closing bracket
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
     1
8043
da083f8d95e6 We need custom script loading function in lua now
unc0rr
parents: 7877
diff changeset
     2
HedgewarsScriptLoad("/Scripts/Locale.lua")
13501
cbda0f842364 Standardize hidden mission achievement in new Lua library "Achievements"
Wuzzy <Wuzzy2@mail.ru>
parents: 12938
diff changeset
     3
HedgewarsScriptLoad("/Scripts/Achievements.lua")
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
     4
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
     5
local player = nil -- This variable will point to the hog's gear
14499
cc358e997e32 Fix team name bugs in RC Plane Challenge and Dangerous Ducklings
Wuzzy <Wuzzy2@mail.ru>
parents: 14487
diff changeset
     6
local playerTeamName, enemyTeamName = nil, nil
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
     7
local instructor = nil
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
     8
local enemy = nil
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
     9
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    10
local speechStage = 0
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    11
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    12
local gameLost = false
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    13
local gameWon = false
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    14
local notListening = false
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    15
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    16
local endTimer = 0
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    17
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    18
function onGameInit()
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    19
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    20
	-- Things we don't modify here will use their default values.
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    21
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    22
	Seed = 0 -- The base number for the random number generator
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    23
	GameFlags = gfInfAttack -- Game settings and rules
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    24
	TurnTime = 60000 -- The time the player has to move each round (in ms)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    25
	CaseFreq = 0 -- The frequency of crate drops
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    26
	MinesNum = 0 -- The number of mines being placed
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    27
	Explosives = 0 -- The number of explosives being placed
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    28
	Map = "Bath" -- The map to be played
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    29
	Theme = "Bath" -- The theme to be used
12229
d62d6f8ebef1 Disable Sudden Death consistently in all missions which don't require it
Wuzzy <almikes@aol.com>
parents: 12083
diff changeset
    30
	-- Disable Sudden Death
d62d6f8ebef1 Disable Sudden Death consistently in all missions which don't require it
Wuzzy <almikes@aol.com>
parents: 12083
diff changeset
    31
	HealthDecrease = 0
d62d6f8ebef1 Disable Sudden Death consistently in all missions which don't require it
Wuzzy <almikes@aol.com>
parents: 12083
diff changeset
    32
	WaterRise = 0
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    33
14499
cc358e997e32 Fix team name bugs in RC Plane Challenge and Dangerous Ducklings
Wuzzy <Wuzzy2@mail.ru>
parents: 14487
diff changeset
    34
	playerTeamName = AddMissionTeam(-1)
14487
d4aa64f51c9f Use player-chosen team identity for most challenges and scenarios
Wuzzy <Wuzzy2@mail.ru>
parents: 14469
diff changeset
    35
	player = AddMissionHog(1)
9088
553355472675 Fix broken x/y values on Dangerous Ducklings
mikade <redgrinner@gmail.com>
parents: 8043
diff changeset
    36
	instructor = AddHog(loc("Instructor"), 0, 100, "sf_vega")
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    37
14937
ff4003a90ff8 Enable automatic voicepack language selection for all missions
Wuzzy <Wuzzy2@mail.ru>
parents: 14499
diff changeset
    38
	enemyTeamName = AddTeam(loc("Blue Team"), -2, "bubble", "Island", "Default_qau", "somalia")
9088
553355472675 Fix broken x/y values on Dangerous Ducklings
mikade <redgrinner@gmail.com>
parents: 8043
diff changeset
    39
	enemy = AddHog(loc("Filthy Blue"), 1, 100, "Skull")
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    40
7877
b3fb94986255 Fix training script positions altered by variable land dimension change. Issue #453
nemo
parents: 5823
diff changeset
    41
	SetGearPosition(player,146,902)
b3fb94986255 Fix training script positions altered by variable land dimension change. Issue #453
nemo
parents: 5823
diff changeset
    42
	SetGearPosition(instructor,317,902)
b3fb94986255 Fix training script positions altered by variable land dimension change. Issue #453
nemo
parents: 5823
diff changeset
    43
	SetGearPosition(enemy,1918,837)
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    44
14244
748c611bee79 Remove some chatslang from missions
Wuzzy <Wuzzy2@mail.ru>
parents: 13749
diff changeset
    45
	HogSay(player, loc("..."), SAY_THINK)
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    46
	HogTurnLeft(instructor, true)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    47
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    48
end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    49
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    50
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    51
function onGameStart()
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    52
12938
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12908
diff changeset
    53
	SpawnSupplyCrate(475,476,amRope)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12908
diff changeset
    54
	SpawnSupplyCrate(1729,476,amFirePunch)
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    55
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    56
	FollowGear(player)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    57
14487
d4aa64f51c9f Use player-chosen team identity for most challenges and scenarios
Wuzzy <Wuzzy2@mail.ru>
parents: 14469
diff changeset
    58
	ShowMission(loc("Dangerous Ducklings"), loc("Scenario"), loc("Eliminate the enemy before the time runs out."), -amRope, 5000);
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    59
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    60
end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    61
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    62
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    63
function onGameTick()
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    64
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    65
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    66
	-- opening speech
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    67
	if (notListening == false) and (gameLost == false) then
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    68
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    69
		if (TurnTimeLeft == 58000) and (speechStage == 0)  then
12908
9e7c1d5eec73 String cleanup: Double/triple exclamation marks
Wuzzy <Wuzzy2@mail.ru>
parents: 12776
diff changeset
    70
			HogSay(instructor, loc("Listen up, maggot!"), SAY_SHOUT)
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    71
			speechStage = 1
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    72
		elseif (TurnTimeLeft == 57000) and (speechStage == 1) then
12908
9e7c1d5eec73 String cleanup: Double/triple exclamation marks
Wuzzy <Wuzzy2@mail.ru>
parents: 12776
diff changeset
    73
			HogSay(player,loc("!"),SAY_SHOUT)
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    74
		elseif (TurnTimeLeft == 55000) and (speechStage == 1) then
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    75
			HogSay(instructor, loc("The enemy is hiding out on yonder ducky!"), SAY_SAY)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    76
			speechStage = 2
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    77
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    78
		elseif (TurnTimeLeft == 49000) and (speechStage == 2) then
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    79
			FollowGear(enemy)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    80
		elseif (TurnTimeLeft == 46500) and (speechStage == 2) then
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    81
			FollowGear(instructor)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    82
			HogSay(instructor, loc("Get on over there and take him out!"), SAY_SAY)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    83
			speechStage = 3
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    84
		elseif (TurnTimeLeft == 43500) and (speechStage == 3) then
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    85
			HogSay(instructor, loc("GO! GO! GO!"), SAY_SHOUT)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    86
			speechStage = 4
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    87
			givenSpeech = true
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    88
		end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    89
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    90
	end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    91
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    92
	-- if player falls in water or if player ignores speech
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    93
	if (CurrentHedgehog ~= nil) and (CurrentHedgehog == player) then
9088
553355472675 Fix broken x/y values on Dangerous Ducklings
mikade <redgrinner@gmail.com>
parents: 8043
diff changeset
    94
		if (GetY(player) > WaterLine) and (gameLost == false) then
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    95
			HogSay(instructor, loc("DAMMIT, ROOKIE!"), SAY_SHOUT)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    96
			gameLost = true
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    97
		end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    98
9088
553355472675 Fix broken x/y values on Dangerous Ducklings
mikade <redgrinner@gmail.com>
parents: 8043
diff changeset
    99
		if (GetX(player) > 300) and (GetY(player) > 880) and (notListening == false) and (speechStage < 3) then
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   100
			HogSay(instructor, loc("DAMMIT, ROOKIE! GET OFF MY HEAD!"), SAY_SHOUT)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   101
			notListening = true
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   102
		end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   103
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   104
	end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   105
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   106
	--player out of time
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   107
	if (TurnTimeLeft == 1) and (gameWon == false) then
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   108
		SetHealth(player, 0)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   109
	end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   110
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   111
	-- meh
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   112
	if gameLost == true then
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   113
		endTimer = endTimer + 1
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   114
		if (CurrentHedgehog ~= nil) and (CurrentHedgehog == instructor) then
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   115
			if endTimer >= 3000 then
13745
2bb7141496a9 Use SetTurnTimeLeft and SetReadyTimeLeft in all scripts
Wuzzy <Wuzzy2@mail.ru>
parents: 13588
diff changeset
   116
				SetTurnTimeLeft(1)
14499
cc358e997e32 Fix team name bugs in RC Plane Challenge and Dangerous Ducklings
Wuzzy <Wuzzy2@mail.ru>
parents: 14487
diff changeset
   117
				DismissTeam(playerTeamName)
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   118
			end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   119
		end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   120
	end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   121
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   122
end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   123
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   124
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   125
function onAmmoStoreInit()
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   126
	SetAmmo(amFirePunch, 0, 0, 0, 1)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   127
	SetAmmo(amParachute, 1, 0, 0, 0)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   128
	SetAmmo(amRope, 0, 0, 0, 1)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   129
end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   130
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   131
function onGearDelete(gear)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   132
	if GetGearType(gear) == gtHedgehog then
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   133
		if gear == player then
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   134
			gameLost = true
9088
553355472675 Fix broken x/y values on Dangerous Ducklings
mikade <redgrinner@gmail.com>
parents: 8043
diff changeset
   135
		elseif (gear == instructor) and (GetY(gear) > WaterLine) then
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   136
			HogSay(player, loc("See ya!"), SAY_THINK)
13749
4b79bac864be Dangerous Ducklings: Enter retreat mode after kill
Wuzzy <Wuzzy2@mail.ru>
parents: 13745
diff changeset
   137
			Retreat(3000)
13501
cbda0f842364 Standardize hidden mission achievement in new Lua library "Achievements"
Wuzzy <Wuzzy2@mail.ru>
parents: 12938
diff changeset
   138
			awardAchievement(loc("Naughty Ninja"))
14499
cc358e997e32 Fix team name bugs in RC Plane Challenge and Dangerous Ducklings
Wuzzy <Wuzzy2@mail.ru>
parents: 14487
diff changeset
   139
			DismissTeam(enemyTeamName)
9088
553355472675 Fix broken x/y values on Dangerous Ducklings
mikade <redgrinner@gmail.com>
parents: 8043
diff changeset
   140
			gameWon = true
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   141
		elseif gear == enemy then
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   142
			HogSay(player, loc("Enjoy the swim..."), SAY_THINK)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   143
			gameWon = true
13749
4b79bac864be Dangerous Ducklings: Enter retreat mode after kill
Wuzzy <Wuzzy2@mail.ru>
parents: 13745
diff changeset
   144
			Retreat(3000)
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   145
		end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   146
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   147
	end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   148
end
15096
5c8c729a16ce Scenarios: Show "Mission succeeded/failed!" in stats screen
Wuzzy <Wuzzy2@mail.ru>
parents: 14937
diff changeset
   149
5c8c729a16ce Scenarios: Show "Mission succeeded/failed!" in stats screen
Wuzzy <Wuzzy2@mail.ru>
parents: 14937
diff changeset
   150
function onGameResult(winner)
5c8c729a16ce Scenarios: Show "Mission succeeded/failed!" in stats screen
Wuzzy <Wuzzy2@mail.ru>
parents: 14937
diff changeset
   151
	if winner == GetTeamClan(playerTeamName) then
5c8c729a16ce Scenarios: Show "Mission succeeded/failed!" in stats screen
Wuzzy <Wuzzy2@mail.ru>
parents: 14937
diff changeset
   152
		SaveMissionVar("Won", "true")
5c8c729a16ce Scenarios: Show "Mission succeeded/failed!" in stats screen
Wuzzy <Wuzzy2@mail.ru>
parents: 14937
diff changeset
   153
		SendStat(siGameResult, loc("Mission succeeded!"))
5c8c729a16ce Scenarios: Show "Mission succeeded/failed!" in stats screen
Wuzzy <Wuzzy2@mail.ru>
parents: 14937
diff changeset
   154
	else
5c8c729a16ce Scenarios: Show "Mission succeeded/failed!" in stats screen
Wuzzy <Wuzzy2@mail.ru>
parents: 14937
diff changeset
   155
		SendStat(siGameResult, loc("Mission failed!"))
5c8c729a16ce Scenarios: Show "Mission succeeded/failed!" in stats screen
Wuzzy <Wuzzy2@mail.ru>
parents: 14937
diff changeset
   156
	end
5c8c729a16ce Scenarios: Show "Mission succeeded/failed!" in stats screen
Wuzzy <Wuzzy2@mail.ru>
parents: 14937
diff changeset
   157
end