share/hedgewars/Data/Missions/Scenario/User_Mission_-_Spooky_Tree.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")
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
     3
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
15096
5c8c729a16ce Scenarios: Show "Mission succeeded/failed!" in stats screen
Wuzzy <Wuzzy2@mail.ru>
parents: 15020
diff changeset
     6
local playerTeamName
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
     7
local player = nil -- This variable will point to the hog's gear
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
     8
local instructor = nil
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
     9
local enemy = nil
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    10
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    11
local GameOver = false
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    12
local birdSpeech = false
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    13
local birdSqualk = false
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    14
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    15
local GirderCrate = nil
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    16
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    17
function onGameInit()
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    18
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    19
	-- 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
    20
	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
    21
	GameFlags = gfInfAttack +gfDisableWind-- Game settings and rules
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    22
	TurnTime = 90000 -- 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
    23
	CaseFreq = 0 -- The frequency of crate drops
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    24
	MinesNum = 0 -- The number of mines being placed
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    25
	MinesTime  = 1
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    26
	Explosives = 0 -- The number of explosives being placed
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    27
	Map = "Tree" -- The map to be played
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    28
	Theme = "Halloween" -- 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
    29
	-- Disable Sudden Death
d62d6f8ebef1 Disable Sudden Death consistently in all missions which don't require it
Wuzzy <almikes@aol.com>
parents: 12083
diff changeset
    30
	HealthDecrease = 0
d62d6f8ebef1 Disable Sudden Death consistently in all missions which don't require it
Wuzzy <almikes@aol.com>
parents: 12083
diff changeset
    31
	WaterRise = 0
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    32
15096
5c8c729a16ce Scenarios: Show "Mission succeeded/failed!" in stats screen
Wuzzy <Wuzzy2@mail.ru>
parents: 15020
diff changeset
    33
	playerTeamName = AddMissionTeam(-1)
14487
d4aa64f51c9f Use player-chosen team identity for most challenges and scenarios
Wuzzy <Wuzzy2@mail.ru>
parents: 14469
diff changeset
    34
	player = AddMissionHog(1)
14937
ff4003a90ff8 Enable automatic voicepack language selection for all missions
Wuzzy <Wuzzy2@mail.ru>
parents: 14487
diff changeset
    35
	AddTeam(loc("Toxic Team"), -6, "skull", "Island", "Default_qau", "cm_magicskull")
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    36
	enemy = AddHog(loc("Poison"), 1, 10, "Skull")
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    37
7877
b3fb94986255 Fix training script positions altered by variable land dimension change. Issue #453
nemo
parents: 5823
diff changeset
    38
	SetGearPosition(player,970,23)
b3fb94986255 Fix training script positions altered by variable land dimension change. Issue #453
nemo
parents: 5823
diff changeset
    39
	SetGearPosition(enemy,498,806)
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    40
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    41
end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    42
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    43
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    44
function onGameStart()
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    45
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    46
	--right side mines
7877
b3fb94986255 Fix training script positions altered by variable land dimension change. Issue #453
nemo
parents: 5823
diff changeset
    47
	AddGear(1681,359,gtMine, 0, 0, 0, 0)
b3fb94986255 Fix training script positions altered by variable land dimension change. Issue #453
nemo
parents: 5823
diff changeset
    48
	AddGear(1718,518,gtMine, 0, 0, 0, 0)
b3fb94986255 Fix training script positions altered by variable land dimension change. Issue #453
nemo
parents: 5823
diff changeset
    49
	AddGear(1648,527,gtMine, 0, 0, 0, 0)
b3fb94986255 Fix training script positions altered by variable land dimension change. Issue #453
nemo
parents: 5823
diff changeset
    50
	AddGear(1584,522,gtMine, 0, 0, 0, 0)
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    51
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    52
	--tunnel mines
7877
b3fb94986255 Fix training script positions altered by variable land dimension change. Issue #453
nemo
parents: 5823
diff changeset
    53
	AddGear(301,569,gtSMine, 0, 0, 0, 0)
b3fb94986255 Fix training script positions altered by variable land dimension change. Issue #453
nemo
parents: 5823
diff changeset
    54
	AddGear(372,608,gtSMine, 0, 0, 0, 0)
b3fb94986255 Fix training script positions altered by variable land dimension change. Issue #453
nemo
parents: 5823
diff changeset
    55
	AddGear(453,628,gtSMine, 0, 0, 0, 0)
b3fb94986255 Fix training script positions altered by variable land dimension change. Issue #453
nemo
parents: 5823
diff changeset
    56
	AddGear(524,611,gtSMine, 0, 0, 0, 0)
b3fb94986255 Fix training script positions altered by variable land dimension change. Issue #453
nemo
parents: 5823
diff changeset
    57
	AddGear(613,611,gtSMine, 0, 0, 0, 0)
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    58
7877
b3fb94986255 Fix training script positions altered by variable land dimension change. Issue #453
nemo
parents: 5823
diff changeset
    59
	AddGear(308,486,gtSMine, 0, 0, 0, 0)
b3fb94986255 Fix training script positions altered by variable land dimension change. Issue #453
nemo
parents: 5823
diff changeset
    60
	AddGear(372,478,gtSMine, 0, 0, 0, 0)
b3fb94986255 Fix training script positions altered by variable land dimension change. Issue #453
nemo
parents: 5823
diff changeset
    61
	AddGear(453,466,gtSMine, 0, 0, 0, 0)
b3fb94986255 Fix training script positions altered by variable land dimension change. Issue #453
nemo
parents: 5823
diff changeset
    62
	AddGear(524,471,gtSMine, 0, 0, 0, 0)
b3fb94986255 Fix training script positions altered by variable land dimension change. Issue #453
nemo
parents: 5823
diff changeset
    63
	AddGear(613,466,gtSMine, 0, 0, 0, 0)
4662
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
	--above the tunnel mines
7877
b3fb94986255 Fix training script positions altered by variable land dimension change. Issue #453
nemo
parents: 5823
diff changeset
    66
	AddGear(331,433,gtMine, 0, 0, 0, 0)
b3fb94986255 Fix training script positions altered by variable land dimension change. Issue #453
nemo
parents: 5823
diff changeset
    67
	AddGear(404,420,gtMine, 0, 0, 0, 0)
b3fb94986255 Fix training script positions altered by variable land dimension change. Issue #453
nemo
parents: 5823
diff changeset
    68
	AddGear(484,424,gtMine, 0, 0, 0, 0)
b3fb94986255 Fix training script positions altered by variable land dimension change. Issue #453
nemo
parents: 5823
diff changeset
    69
	AddGear(562,417,gtMine, 0, 0, 0, 0)
b3fb94986255 Fix training script positions altered by variable land dimension change. Issue #453
nemo
parents: 5823
diff changeset
    70
	AddGear(640,412,gtMine, 0, 0, 0, 0)
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    71
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    72
	-- crates crates and more crates
12938
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12591
diff changeset
    73
	SpawnSupplyCrate(1208,576,amBlowTorch)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12591
diff changeset
    74
	SpawnSupplyCrate(1467,376,amPickHammer)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12591
diff changeset
    75
	SpawnSupplyCrate(373,165,amGirder)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12591
diff changeset
    76
	SpawnSupplyCrate(704,623,amJetpack)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12591
diff changeset
    77
	SpawnSupplyCrate(1646,749,amLaserSight)
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    78
12938
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12591
diff changeset
    79
	SpawnSupplyCrate(745,418,amShotgun) --shotgun1
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12591
diff changeset
    80
	SpawnSupplyCrate(833,432,amFirePunch) --fire punch
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12591
diff changeset
    81
	GirderCrate = SpawnSupplyCrate(1789,514,amShotgun) -- final shotgun
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12591
diff changeset
    82
	SpawnSupplyCrate(1181,419,amBee)
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    83
12356
62b935bec899 Mention important game modifiers in Spooky Tree and Nobody Laugh
Wuzzy <almikes@aol.com>
parents: 12231
diff changeset
    84
	ShowMission(loc("Spooky Tree"), loc("Scenario"),
62b935bec899 Mention important game modifiers in Spooky Tree and Nobody Laugh
Wuzzy <almikes@aol.com>
parents: 12231
diff changeset
    85
		loc("Eliminate the enemy before the time runs out.") .. "|" ..
62b935bec899 Mention important game modifiers in Spooky Tree and Nobody Laugh
Wuzzy <almikes@aol.com>
parents: 12231
diff changeset
    86
		loc("Unlimited Attacks: Attacks don't end your turn") .. "|" ..
62b935bec899 Mention important game modifiers in Spooky Tree and Nobody Laugh
Wuzzy <almikes@aol.com>
parents: 12231
diff changeset
    87
		loc("Mines time: 0 seconds"), -amBee, 0)
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    88
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    89
	SetWind(-75)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    90
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    91
end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    92
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    93
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    94
function onGameTick()
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    95
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    96
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    97
	if CurrentHedgehog ~= nil then
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    98
7877
b3fb94986255 Fix training script positions altered by variable land dimension change. Issue #453
nemo
parents: 5823
diff changeset
    99
		if (birdSqualk == false) and (GetX(CurrentHedgehog) == 1102) and (GetY(CurrentHedgehog) == 133)  then
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   100
			birdSqualk = true
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   101
			PlaySound(sndBirdyLay)
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
7877
b3fb94986255 Fix training script positions altered by variable land dimension change. Issue #453
nemo
parents: 5823
diff changeset
   104
		if (birdSpeech == false) and (GetX(CurrentHedgehog) == 1068) and (GetY(CurrentHedgehog) == 162) then
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   105
			birdSpeech = true
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   106
			HogSay(player,loc("Good birdy......"),SAY_THINK)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   107
		end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   108
	end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   109
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   110
	if CurrentHedgehog ~= nil then
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   111
		--AddCaption(GetX(CurrentHedgehog) .. ";" .. GetY(CurrentHedgehog))
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   112
	end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   113
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   114
	if (TotalRounds == 2) and (GameOver == false) then -- just in case
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   115
		SetHealth(player, 0)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   116
		GameOver = true
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   117
	end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   118
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   119
	if TurnTimeLeft == 1 then
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   120
		SetHealth(player, 0)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   121
		GameOver = true
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
end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   125
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   126
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   127
function onAmmoStoreInit()
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   128
	SetAmmo(amShotgun, 0, 0, 0, 1)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   129
	SetAmmo(amFirePunch, 0, 0, 0, 1)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   130
	SetAmmo(amBee, 0, 0, 0, 1)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   131
	SetAmmo(amBlowTorch, 0, 0, 0, 1)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   132
	SetAmmo(amGirder, 0, 0, 0, 1)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   133
	SetAmmo(amParachute, 1, 0, 0, 1)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   134
	SetAmmo(amPickHammer, 0, 0, 0, 1)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   135
	SetAmmo(amJetpack, 0, 0, 0, 1)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   136
	SetAmmo(amLaserSight, 0, 0, 0, 1)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   137
end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   138
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   139
function onGearDelete(gear)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   140
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   141
	if gear == GirderCrate then
13745
2bb7141496a9 Use SetTurnTimeLeft and SetReadyTimeLeft in all scripts
Wuzzy <Wuzzy2@mail.ru>
parents: 13588
diff changeset
   142
		SetTurnTimeLeft(TurnTimeLeft + 30000)
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   143
	end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   144
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   145
	if GetGearType(gear) == gtCase then
13745
2bb7141496a9 Use SetTurnTimeLeft and SetReadyTimeLeft in all scripts
Wuzzy <Wuzzy2@mail.ru>
parents: 13588
diff changeset
   146
		SetTurnTimeLeft(TurnTimeLeft + 5000)
4662
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
15020
a1165392c9db Scenarios: Drawn games count as mission failure
Wuzzy <Wuzzy2@mail.ru>
parents: 14937
diff changeset
   149
end
a1165392c9db Scenarios: Drawn games count as mission failure
Wuzzy <Wuzzy2@mail.ru>
parents: 14937
diff changeset
   150
a1165392c9db Scenarios: Drawn games count as mission failure
Wuzzy <Wuzzy2@mail.ru>
parents: 14937
diff changeset
   151
function onGameResult(winner)
15096
5c8c729a16ce Scenarios: Show "Mission succeeded/failed!" in stats screen
Wuzzy <Wuzzy2@mail.ru>
parents: 15020
diff changeset
   152
	if winner == GetTeamClan(playerTeamName) then
14469
ead8928a59f8 Report mission victory for most missions
Wuzzy <Wuzzy2@mail.ru>
parents: 14406
diff changeset
   153
		SaveMissionVar("Won", "true")
15096
5c8c729a16ce Scenarios: Show "Mission succeeded/failed!" in stats screen
Wuzzy <Wuzzy2@mail.ru>
parents: 15020
diff changeset
   154
		SendStat(siGameResult, loc("Mission succeeded!"))
15020
a1165392c9db Scenarios: Drawn games count as mission failure
Wuzzy <Wuzzy2@mail.ru>
parents: 14937
diff changeset
   155
		GameOver = true
a1165392c9db Scenarios: Drawn games count as mission failure
Wuzzy <Wuzzy2@mail.ru>
parents: 14937
diff changeset
   156
	else
15096
5c8c729a16ce Scenarios: Show "Mission succeeded/failed!" in stats screen
Wuzzy <Wuzzy2@mail.ru>
parents: 15020
diff changeset
   157
		SendStat(siGameResult, loc("Mission failed!"))
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   158
		GameOver = true
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   159
	end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   160
end