share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/desert02.lua
author Periklis Ntanasis <pntanasis@gmail.com>
Sat, 24 Aug 2013 06:36:02 +0300
branchspacecampaign
changeset 9574 da3d39667881
parent 9490 b93448b75fa4
child 9582 bf314b2258b3
permissions -rw-r--r--
strings checked, all ok except ice02 that will be probably changed
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9467
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     1
------------------- ABOUT ----------------------
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     2
--
9471
867f020b0621 seems ok, stats to be added
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9469
diff changeset
     3
-- Hero has to get to the surface as soon as possible.
867f020b0621 seems ok, stats to be added
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9469
diff changeset
     4
-- Tunnel is about to get flooded.
9467
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     5
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     6
HedgewarsScriptLoad("/Scripts/Locale.lua")
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     7
HedgewarsScriptLoad("/Scripts/Animate.lua")
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     8
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     9
----------------- VARIABLES --------------------
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    10
-- globals
9574
da3d39667881 strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9490
diff changeset
    11
local missionName = loc("Running for survival")
9474
c255f6c46e33 stats and minor corrections, difficulty adjustment
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9471
diff changeset
    12
local startChallenge = false
9467
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    13
-- dialogs
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    14
local dialog01 = {}
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    15
-- mission objectives
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    16
local goals = {
9471
867f020b0621 seems ok, stats to be added
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9469
diff changeset
    17
	[dialog01] = {missionName, loc("Getting ready"), loc("Use the rope and get asap to the surface!"), 1, 4500},
9467
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    18
}
9490
b93448b75fa4 fix bugs and some changes regarting the difficulty in desert02
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9484
diff changeset
    19
-- health crates
b93448b75fa4 fix bugs and some changes regarting the difficulty in desert02
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9484
diff changeset
    20
healthX = 565
b93448b75fa4 fix bugs and some changes regarting the difficulty in desert02
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9484
diff changeset
    21
health1Y = 1400
b93448b75fa4 fix bugs and some changes regarting the difficulty in desert02
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9484
diff changeset
    22
health2Y = 850
9467
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    23
-- hogs
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    24
local hero = {}
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    25
-- teams
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    26
local teamA = {}
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    27
-- hedgehogs values
9574
da3d39667881 strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9490
diff changeset
    28
hero.name = loc("Hog Solo")
9467
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    29
hero.x = 1600
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    30
hero.y = 1950
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    31
hero.dead = false
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    32
teamA.name = loc("Hog Solo")
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    33
teamA.color = tonumber("38D61C",16) -- green
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    34
-- way points
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    35
local current waypoint = 1
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    36
local waypoints = { 
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    37
	[1] = {x=1450, y=140},
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    38
	[2] = {x=990, y=580},
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    39
	[3] = {x=1650, y=950},
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    40
	[4] = {x=620, y=630},
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    41
	[5] = {x=1470, y=540},
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    42
	[6] = {x=1960, y=60},
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    43
	[7] = {x=1600, y=400},
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    44
	[8] = {x=240, y=940},
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    45
	[9] = {x=200, y=530},
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    46
	[10] = {x=1180, y=120},
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    47
	[11] = {x=1950, y=660},
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    48
	[12] = {x=1280, y=980},
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    49
	[13] = {x=590, y=1100},
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    50
	[14] = {x=20, y=620},
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    51
	[15] = {x=hero.x, y=hero.y}
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    52
}
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    53
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    54
-------------- LuaAPI EVENT HANDLERS ------------------
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    55
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    56
function onGameInit()
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    57
	GameFlags = gfOneClanMode
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    58
	Seed = 1
9474
c255f6c46e33 stats and minor corrections, difficulty adjustment
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9471
diff changeset
    59
	TurnTime = 8000
9467
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    60
	Delay = 2
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    61
	CaseFreq = 0
9490
b93448b75fa4 fix bugs and some changes regarting the difficulty in desert02
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9484
diff changeset
    62
	HealthCaseAmount = 50
9471
867f020b0621 seems ok, stats to be added
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9469
diff changeset
    63
	MinesNum = 500
867f020b0621 seems ok, stats to be added
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9469
diff changeset
    64
	MinesTime = 1000
867f020b0621 seems ok, stats to be added
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9469
diff changeset
    65
	MineDudPercent = 75
9467
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    66
	Explosives = 0
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    67
	SuddenDeathTurns = 1
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    68
	WaterRise = 150
9490
b93448b75fa4 fix bugs and some changes regarting the difficulty in desert02
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9484
diff changeset
    69
	HealthDecrease = 0
9467
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    70
	Map = "desert02_map"
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    71
	Theme = "Desert"
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    72
	
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    73
	-- Hog Solo
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    74
	AddTeam(teamA.name, teamA.color, "Bone", "Island", "HillBilly", "cm_birdy")
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    75
	hero.gear = AddHog(hero.name, 0, 100, "war_desertgrenadier1")
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    76
	AnimSetGearPosition(hero.gear, hero.x, hero.y)
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    77
	HogTurnLeft(hero.gear, true)
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    78
	
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    79
	AnimInit()
9490
b93448b75fa4 fix bugs and some changes regarting the difficulty in desert02
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9484
diff changeset
    80
	AnimationSetup()
9467
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    81
end
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    82
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    83
function onGameStart()
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    84
	AnimWait(hero.gear, 3000)
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    85
	FollowGear(hero.gear)
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    86
	
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    87
	AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0)
9471
867f020b0621 seems ok, stats to be added
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9469
diff changeset
    88
	AddEvent(onHeroSafe, {hero.gear}, heroSafe, {hero.gear}, 0)
9467
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    89
	
9490
b93448b75fa4 fix bugs and some changes regarting the difficulty in desert02
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9484
diff changeset
    90
	SpawnHealthCrate(healthX, health1Y)
b93448b75fa4 fix bugs and some changes regarting the difficulty in desert02
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9484
diff changeset
    91
	SpawnHealthCrate(healthX, health2Y)
b93448b75fa4 fix bugs and some changes regarting the difficulty in desert02
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9484
diff changeset
    92
	
9467
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    93
	AddAmmo(hero.gear, amRope, 99)
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    94
	
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    95
	SendHealthStatsOff()
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    96
	AddAnim(dialog01)
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    97
end
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    98
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    99
function onGameTick()
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   100
	AnimUnWait()
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   101
	if ShowAnimation() == false then
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   102
		return
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   103
	end
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   104
	ExecuteAfterAnimations()
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   105
	CheckEvents()
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   106
end
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   107
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   108
function onGearDelete(gear)
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   109
	if gear == hero.gear then
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   110
		hero.dead = true
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   111
	end
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   112
end
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   113
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   114
function onPrecise()
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   115
	if GameTime > 3000 then
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   116
		SetAnimSkip(true)   
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   117
	end
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   118
end
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   119
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   120
-------------- EVENTS ------------------
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   121
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   122
function onHeroDeath(gear)
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   123
	if hero.dead then
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   124
		return true
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   125
	end
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   126
	return false
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   127
end
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   128
9469
6896f9298b80 event for win
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9467
diff changeset
   129
function onHeroSafe(gear)
9474
c255f6c46e33 stats and minor corrections, difficulty adjustment
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9471
diff changeset
   130
	if not hero.dead and GetY(hero.gear) < 170 and StoppedGear(hero.gear) then
9469
6896f9298b80 event for win
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9467
diff changeset
   131
		return true
6896f9298b80 event for win
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9467
diff changeset
   132
	end
6896f9298b80 event for win
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9467
diff changeset
   133
	return false
6896f9298b80 event for win
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9467
diff changeset
   134
end
6896f9298b80 event for win
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9467
diff changeset
   135
9467
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   136
-------------- OUTCOMES ------------------
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   137
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   138
function heroDeath(gear)
9474
c255f6c46e33 stats and minor corrections, difficulty adjustment
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9471
diff changeset
   139
	SendStat('siGameResult', loc("Hog Solo lost, try again!")) --1
c255f6c46e33 stats and minor corrections, difficulty adjustment
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9471
diff changeset
   140
	SendStat('siCustomAchievement', loc("To win the game you have to go to the surface")) --11
c255f6c46e33 stats and minor corrections, difficulty adjustment
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9471
diff changeset
   141
	SendStat('siCustomAchievement', loc("Most mines are not active")) --11
c255f6c46e33 stats and minor corrections, difficulty adjustment
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9471
diff changeset
   142
	SendStat('siCustomAchievement', loc("From the second turn and beyond the water rises")) --11
c255f6c46e33 stats and minor corrections, difficulty adjustment
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9471
diff changeset
   143
	SendStat('siPlayerKills','0',teamA.name)
9471
867f020b0621 seems ok, stats to be added
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9469
diff changeset
   144
	EndGame()
9467
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   145
end
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   146
9469
6896f9298b80 event for win
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9467
diff changeset
   147
function heroSafe(gear)
9574
da3d39667881 strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9490
diff changeset
   148
	SendStat('siGameResult', loc("Congratulations, you won!")) --1
9474
c255f6c46e33 stats and minor corrections, difficulty adjustment
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9471
diff changeset
   149
	SendStat('siCustomAchievement', loc("You have escaped successfully")) --11
9490
b93448b75fa4 fix bugs and some changes regarting the difficulty in desert02
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9484
diff changeset
   150
	SendStat('siCustomAchievement', loc("Your escape took you "..TotalRounds.." turns")) --11
9474
c255f6c46e33 stats and minor corrections, difficulty adjustment
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9471
diff changeset
   151
	SendStat('siPlayerKills','1',teamA.name)
9469
6896f9298b80 event for win
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9467
diff changeset
   152
	EndGame()
6896f9298b80 event for win
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9467
diff changeset
   153
end
6896f9298b80 event for win
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9467
diff changeset
   154
9467
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   155
-------------- ANIMATIONS ------------------
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   156
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   157
function Skipanim(anim)
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   158
	if goals[anim] ~= nil then
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   159
		ShowMission(unpack(goals[anim]))
9474
c255f6c46e33 stats and minor corrections, difficulty adjustment
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9471
diff changeset
   160
    end
c255f6c46e33 stats and minor corrections, difficulty adjustment
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9471
diff changeset
   161
	challengeStart()
9467
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   162
end
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   163
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   164
function AnimationSetup()
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   165
	-- DIALOG 01 - Start
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   166
	AddSkipFunction(dialog01, Skipanim, {dialog01})
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   167
	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 3000}})
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   168
	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Many meters below the surface..."), 5000}})
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   169
	table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("The tunnel is about to get flooded..."), SAY_THINK, 4000}})
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   170
	table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("I have to reach the surface asap..."), SAY_THINK, 4000}})
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   171
	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 500}})
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   172
	table.insert(dialog01, {func = challengeStart, args = {hero.gear}})
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   173
end
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   174
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   175
------------------ Other Functions -------------------
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   176
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   177
function challengeStart()
9474
c255f6c46e33 stats and minor corrections, difficulty adjustment
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9471
diff changeset
   178
	startChallenge = true
9467
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   179
	TurnTimeLeft = 0
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   180
end