share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/cosmos.lua
author Periklis Ntanasis <pntanasis@gmail.com>
Wed, 18 Dec 2013 03:06:37 +0200
changeset 9802 00216d609140
parent 9758 3b8058b251b8
child 9831 afa4e3e04cc5
permissions -rw-r--r--
desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9258
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     1
------------------- ABOUT ----------------------
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     2
--
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     3
-- This map works as a menu for the hero hog to
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     4
-- navigate through planets. It portrays the hogs
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     5
-- planet and above the planets that he'll later
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     6
-- visit.
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     7
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     8
HedgewarsScriptLoad("/Scripts/Locale.lua")
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     9
HedgewarsScriptLoad("/Scripts/Animate.lua")
9578
16139270448f save main missions' status
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9574
diff changeset
    10
HedgewarsScriptLoad("/Missions/Campaign/A_Space_Adventure/global_functions.lua")
9258
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    11
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    12
----------------- VARIABLES --------------------
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    13
-- globals
9574
da3d39667881 strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9572
diff changeset
    14
local missionName = loc("Spacetrip")
9258
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    15
local timeForGuard1ToTurn = 1000 * 5 -- 5 sec
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    16
local timeForGuard1ToTurnLeft = timeForGuard1ToTurn
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    17
local saucerAcquired = false
9578
16139270448f save main missions' status
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9574
diff changeset
    18
local status
9258
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    19
local checkPointReached = 1 -- 1 is start of the game
9758
3b8058b251b8 some more campaign string tweaks
sheepluva
parents: 9642
diff changeset
    20
local objectives = loc("Go to the moon by using the flying saucer and complete the main mission").."|"..
9638
9db28f0a3f8a dialog changes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9637
diff changeset
    21
loc("Come back to this mission and visit the other planets to collect the crates").."|"..
9db28f0a3f8a dialog changes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9637
diff changeset
    22
loc("Visit the Death Planet after completing all the other planets' main missions").."|"..
9758
3b8058b251b8 some more campaign string tweaks
sheepluva
parents: 9642
diff changeset
    23
loc("Come back to this mission after collecting all the device parts")
9258
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    24
-- dialogs
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    25
local dialog01 = {}
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    26
local dialog02 = {}
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    27
local dialog03 = {}
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    28
local dialog04 = {}
9266
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
    29
local dialog05 = {}
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
    30
local dialog06 = {}
9578
16139270448f save main missions' status
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9574
diff changeset
    31
local dialog07 = {}
9636
e1921235fc78 cosmos, after death01 dialogs
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9635
diff changeset
    32
local dialog08 = {}
9258
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    33
-- mission objectives
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    34
local goals = {
9574
da3d39667881 strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9572
diff changeset
    35
	[dialog01] = {missionName, loc("Getting ready"), loc("Go and collect the crate").."|"..loc("Try not to get spotted by the guards!"), 1, 4500},
9758
3b8058b251b8 some more campaign string tweaks
sheepluva
parents: 9642
diff changeset
    36
	[dialog02] = {missionName, loc("The adventure begins!"), loc("Use the saucer and fly to the moon").."|"..loc("Travel carefully as your fuel is limited"), 1, 4500},
9638
9db28f0a3f8a dialog changes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9637
diff changeset
    37
	[dialog03] = {missionName, loc("An unexpected event!"), loc("Use the saucer and fly away").."|"..loc("Beware, any damage taken will stay until you complete the moon's main mission"), 1, 7000},
9db28f0a3f8a dialog changes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9637
diff changeset
    38
	[dialog04] = {missionName, loc("Objectives"), objectives, 1, 7000},
9db28f0a3f8a dialog changes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9637
diff changeset
    39
	[dialog05] = {missionName, loc("Objectives"), objectives, 1, 7000},
9db28f0a3f8a dialog changes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9637
diff changeset
    40
	[dialog06] = {missionName, loc("Objectives"), objectives, 1, 7000},
9758
3b8058b251b8 some more campaign string tweaks
sheepluva
parents: 9642
diff changeset
    41
	[dialog07] = {missionName, loc("Searching the stars!"), loc("Use the saucer and fly away").."|"..loc("Visit the planets of Ice, Desert and Fruit before you proceed to the Death Planet"), 1, 6000},
9638
9db28f0a3f8a dialog changes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9637
diff changeset
    42
	[dialog08] = {missionName, loc("Saving Hogera"), loc("Fly to the meteorite and detonate the explosives"), 1, 7000}
9258
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    43
}
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    44
-- crates
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    45
local saucerX = 3270
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    46
local saucerY = 1500
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    47
-- hogs
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    48
local hero = {}
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    49
local director = {}
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    50
local doctor = {}
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    51
local guard1 = {}
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    52
local guard2 = {}
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    53
-- teams
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    54
local teamA = {}
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    55
local teamB = {}
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    56
local teamC = {}
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    57
-- hedgehogs values
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    58
hero.name = loc("Hog Solo")
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    59
hero.x = 1450
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    60
hero.y = 1550
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    61
director.name = loc("H")
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    62
director.x = 1350
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    63
director.y = 1550
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    64
doctor.name = loc("Dr.Cornelius")
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    65
doctor.x = 1300
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    66
doctor.y = 1550
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    67
guard1.name = loc("Bob")
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    68
guard1.x = 3350
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    69
guard1.y = 1800
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    70
guard1.turn = false
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    71
guard1.keepTurning = true
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    72
guard2.name = loc("Sam")
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    73
guard2.x = 3400
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    74
guard2.y = 1800
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    75
teamA.name = loc("PAoTH")
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    76
teamA.color = tonumber("FF0000",16) -- red
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    77
teamB.name = loc("Guards")
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    78
teamB.color = tonumber("0033FF",16) -- blue
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    79
teamC.name = loc("Hog Solo")
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    80
teamC.color = tonumber("38D61C",16) -- green
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    81
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    82
-------------- LuaAPI EVENT HANDLERS ------------------
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    83
function onGameInit()
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    84
	Seed = 35
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    85
	GameFlags = gfSolidLand + gfDisableWind
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    86
	TurnTime = 40000
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    87
	CaseFreq = 0
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    88
	MinesNum = 0
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    89
	Explosives = 0
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    90
	Delay = 5
9635
ea454f8a1593 changes in cosmos map
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9619
diff changeset
    91
	-- completed main missions
ea454f8a1593 changes in cosmos map
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9619
diff changeset
    92
	status = getCompletedStatus()
ea454f8a1593 changes in cosmos map
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9619
diff changeset
    93
	if status.death01 then
ea454f8a1593 changes in cosmos map
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9619
diff changeset
    94
		Map = "cosmos2_map"
ea454f8a1593 changes in cosmos map
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9619
diff changeset
    95
	else
ea454f8a1593 changes in cosmos map
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9619
diff changeset
    96
		Map = "cosmos_map" -- custom map included in file
ea454f8a1593 changes in cosmos map
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9619
diff changeset
    97
	end
9258
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    98
	Theme = "Nature"
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    99
	-- I had originally hero in PAoTH team and changed it, may reconsider though
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   100
	-- PAoTH
9758
3b8058b251b8 some more campaign string tweaks
sheepluva
parents: 9642
diff changeset
   101
	AddTeam(teamC.name, teamC.color, "Bone", "Island", "HillBilly", "cm_birdy")
9258
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   102
	hero.gear = AddHog(hero.name, 0, 100, "war_desertgrenadier1")
9758
3b8058b251b8 some more campaign string tweaks
sheepluva
parents: 9642
diff changeset
   103
	AnimSetGearPosition(hero.gear, hero.x, hero.y)
9258
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   104
	HogTurnLeft(hero.gear, true)
9758
3b8058b251b8 some more campaign string tweaks
sheepluva
parents: 9642
diff changeset
   105
	AddTeam(teamA.name, teamA.color, "Bone", "Island", "HillBilly", "cm_birdy")
9258
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   106
	director.gear = AddHog(director.name, 0, 100, "hair_yellow")
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   107
	AnimSetGearPosition(director.gear, director.x, director.y)
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   108
	doctor.gear = AddHog(doctor.name, 0, 100, "Glasses")
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   109
	AnimSetGearPosition(doctor.gear, doctor.x, doctor.y)
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   110
	-- Guards
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   111
	AddTeam(teamB.name, teamB.color, "Bone", "Island", "HillBilly", "cm_birdy")
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   112
	guard1.gear = AddHog(guard1.name, 1, 100, "policecap")
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   113
	AnimSetGearPosition(guard1.gear, guard1.x, guard1.y)
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   114
	guard2.gear = AddHog(guard2.name, 1, 100, "policecap")
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   115
	AnimSetGearPosition(guard2.gear, guard2.x, guard2.y)
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   116
	-- get the check point
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   117
	if tonumber(GetCampaignVar("CosmosCheckPoint")) then
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   118
		checkPointReached = tonumber(GetCampaignVar("CosmosCheckPoint"))
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   119
	end
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   120
	-- do checkpoint stuff needed before game starts
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   121
	if checkPointReached == 1 then
9266
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   122
		-- Start of the game
9258
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   123
	elseif checkPointReached == 2 then
9266
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   124
		-- Hero on the column, just took space ship unnoticed
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   125
		AnimSetGearPosition(hero.gear, saucerX, saucerY)
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   126
	elseif checkPointReached == 3 then
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   127
		-- Hero near column, without space ship unnoticed
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   128
	elseif checkPointReached == 4 then
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   129
		-- Hero visited moon for fuels
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   130
		AnimSetGearPosition(hero.gear, 1110, 850)
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   131
	elseif checkPointReached == 5 then
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   132
		-- Hero has visited a planet, he has plenty of fuels and can change planet
9342
51b5fffe3892 changes about displaying the ice planet mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9328
diff changeset
   133
		if GetCampaignVar("Planet") == "moon" then
51b5fffe3892 changes about displaying the ice planet mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9328
diff changeset
   134
			AnimSetGearPosition(hero.gear, 1110, 850)
51b5fffe3892 changes about displaying the ice planet mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9328
diff changeset
   135
		elseif GetCampaignVar("Planet") == "desertPlanet" then
51b5fffe3892 changes about displaying the ice planet mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9328
diff changeset
   136
			AnimSetGearPosition(hero.gear, 3670, 270)
51b5fffe3892 changes about displaying the ice planet mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9328
diff changeset
   137
		elseif GetCampaignVar("Planet") == "fruitPlanet" then
51b5fffe3892 changes about displaying the ice planet mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9328
diff changeset
   138
			AnimSetGearPosition(hero.gear, 2400, 375)
51b5fffe3892 changes about displaying the ice planet mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9328
diff changeset
   139
		elseif GetCampaignVar("Planet") == "icePlanet" then
51b5fffe3892 changes about displaying the ice planet mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9328
diff changeset
   140
			AnimSetGearPosition(hero.gear, 1440, 260)
9578
16139270448f save main missions' status
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9574
diff changeset
   141
		elseif GetCampaignVar("Planet") == "deathPlanet" then
16139270448f save main missions' status
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9574
diff changeset
   142
			AnimSetGearPosition(hero.gear, 620, 530)
9637
b23f9b7d49fa added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9636
diff changeset
   143
		elseif GetCampaignVar("Planet") == "meteorite" then
b23f9b7d49fa added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9636
diff changeset
   144
			AnimSetGearPosition(hero.gear, 3080, 850)
9342
51b5fffe3892 changes about displaying the ice planet mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9328
diff changeset
   145
		end
9258
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   146
	end
9758
3b8058b251b8 some more campaign string tweaks
sheepluva
parents: 9642
diff changeset
   147
9258
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   148
	AnimInit()
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   149
	AnimationSetup()
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   150
end
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   151
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   152
function onGameStart()
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   153
	-- wait for the first turn to start
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   154
	AnimWait(hero.gear, 3000)
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   155
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   156
	FollowGear(hero.gear)
9574
da3d39667881 strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9572
diff changeset
   157
	ShowMission(loc("Spacetrip"), loc("Getting ready"), loc("Help Hog Solo to find all the parts of the anti-gravity device.")..
9258
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   158
	"|"..loc("Travel to all the neighbor planets and collect all the pieces"), -amSkip, 0)
9758
3b8058b251b8 some more campaign string tweaks
sheepluva
parents: 9642
diff changeset
   159
9258
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   160
	-- do checkpoint stuff needed after game starts
9758
3b8058b251b8 some more campaign string tweaks
sheepluva
parents: 9642
diff changeset
   161
	if checkPointReached == 1 then
9258
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   162
		AddAnim(dialog01)
9618
c937b532f8ec give player only one rope
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9617
diff changeset
   163
		AddAmmo(hero.gear, amRope, 1)
9258
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   164
		AddAmmo(guard1.gear, amDEagle, 2)
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   165
		AddAmmo(guard2.gear, amDEagle, 2)
9758
3b8058b251b8 some more campaign string tweaks
sheepluva
parents: 9642
diff changeset
   166
		SpawnAmmoCrate(saucerX, saucerY, amJetpack)
9258
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   167
		-- EVENT HANDLERS
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   168
		AddEvent(onHeroBeforeTreePosition, {hero.gear}, heroBeforeTreePosition, {hero.gear}, 0)
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   169
		AddEvent(onHeroAtSaucerPosition, {hero.gear}, heroAtSaucerPosition, {hero.gear}, 0)
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   170
		AddEvent(onHeroOutOfGuardSight, {hero.gear}, heroOutOfGuardSight, {hero.gear}, 0)
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   171
	elseif checkPointReached == 2 then
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   172
		AddAmmo(hero.gear, amJetpack, 1)
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   173
		AddAnim(dialog02)
9266
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   174
	elseif checkPointReached == 3 then
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   175
		-- Hero near column, without space ship unnoticed
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   176
	elseif checkPointReached == 4 then
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   177
		-- Hero visited moon for fuels
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   178
		AddAnim(dialog05)
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   179
	elseif checkPointReached == 5 then
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   180
		-- Hero has visited a planet, he has plenty of fuels and can change planet
9342
51b5fffe3892 changes about displaying the ice planet mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9328
diff changeset
   181
		AddAmmo(hero.gear, amJetpack, 99)
9266
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   182
	end
9758
3b8058b251b8 some more campaign string tweaks
sheepluva
parents: 9642
diff changeset
   183
9328
811574013fed more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9326
diff changeset
   184
	AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0)
811574013fed more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9326
diff changeset
   185
	AddEvent(onNoFuelAtLand, {hero.gear}, noFuelAtLand, {hero.gear}, 0)
9266
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   186
	-- always check for landings
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   187
	if GetCampaignVar("Planet") ~= "moon" then
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   188
		AddEvent(onMoonLanding, {hero.gear}, moonLanding, {hero.gear}, 0)
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   189
	end
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   190
	if GetCampaignVar("Planet") ~= "desertPlanet" then
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   191
		AddEvent(onDesertPlanetLanding, {hero.gear}, desertPlanetLanding, {hero.gear}, 0)
9758
3b8058b251b8 some more campaign string tweaks
sheepluva
parents: 9642
diff changeset
   192
	end
9266
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   193
	if GetCampaignVar("Planet") ~= "fruitPlanet" then
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   194
		AddEvent(onFruitPlanetLanding, {hero.gear}, fruitPlanetLanding, {hero.gear}, 0)
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   195
	end
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   196
	if GetCampaignVar("Planet") ~= "icePlanet" then
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   197
		AddEvent(onIcePlanetLanding, {hero.gear}, icePlanetLanding, {hero.gear}, 0)
9258
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   198
	end
9572
278cff2a965f added death planet in cosmos without the order restriction yet
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9484
diff changeset
   199
	if GetCampaignVar("Planet") ~= "deathPlanet" then
278cff2a965f added death planet in cosmos without the order restriction yet
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9484
diff changeset
   200
		AddEvent(onDeathPlanetLanding, {hero.gear}, deathPlanetLanding, {hero.gear}, 0)
278cff2a965f added death planet in cosmos without the order restriction yet
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9484
diff changeset
   201
	end
9758
3b8058b251b8 some more campaign string tweaks
sheepluva
parents: 9642
diff changeset
   202
9636
e1921235fc78 cosmos, after death01 dialogs
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9635
diff changeset
   203
	if status.death01 and not status.final then
e1921235fc78 cosmos, after death01 dialogs
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9635
diff changeset
   204
		AddAnim(dialog08)
9637
b23f9b7d49fa added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9636
diff changeset
   205
		if GetCampaignVar("Planet") ~= "meteorite" then
b23f9b7d49fa added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9636
diff changeset
   206
			AddEvent(onMeteoriteLanding, {hero.gear}, meteoriteLanding, {hero.gear}, 0)
b23f9b7d49fa added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9636
diff changeset
   207
		end
9636
e1921235fc78 cosmos, after death01 dialogs
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9635
diff changeset
   208
	end
9758
3b8058b251b8 some more campaign string tweaks
sheepluva
parents: 9642
diff changeset
   209
9584
a7bf5464dfb6 add stats to cosmos
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9580
diff changeset
   210
	SendHealthStatsOff()
9258
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   211
end
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   212
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   213
function onGameTick()
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   214
	-- maybe alert this to avoid timeForGuard1ToTurnLeft overflow
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   215
	if timeForGuard1ToTurnLeft == 0 and guard1.keepTurning then
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   216
		guard1.turn = not guard1.turn
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   217
		HogTurnLeft(guard1.gear, guard1.turn)
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   218
		timeForGuard1ToTurnLeft = timeForGuard1ToTurn
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   219
	end
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   220
	timeForGuard1ToTurnLeft = timeForGuard1ToTurnLeft - 1
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   221
	AnimUnWait()
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   222
	if ShowAnimation() == false then
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   223
		return
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   224
	end
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   225
	ExecuteAfterAnimations()
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   226
	CheckEvents()
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   227
end
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   228
9802
00216d609140 desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9758
diff changeset
   229
function onGameTick20()
00216d609140 desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9758
diff changeset
   230
	setFoundDeviceVisual()
00216d609140 desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9758
diff changeset
   231
end
00216d609140 desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9758
diff changeset
   232
9258
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   233
function onPrecise()
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   234
	if GameTime > 3000 then
9758
3b8058b251b8 some more campaign string tweaks
sheepluva
parents: 9642
diff changeset
   235
		SetAnimSkip(true)
9258
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   236
	end
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   237
end
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   238
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   239
function onAmmoStoreInit()
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   240
	SetAmmo(amJetpack, 0, 0, 0, 1)
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   241
end
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   242
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   243
function onNewTurn()
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   244
	if CurrentHedgehog == director.gear or CurrentHedgehog == doctor.gear then
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   245
		TurnTimeLeft = 0
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   246
	end
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   247
	if guard1.keepTurning then
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   248
		AnimSwitchHog(hero.gear)
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   249
		TurnTimeLeft = -1
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   250
	end
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   251
end
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   252
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   253
-------------- EVENTS ------------------
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   254
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   255
function onHeroBeforeTreePosition(gear)
9328
811574013fed more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9326
diff changeset
   256
	if GetHealth(hero.gear) and GetX(gear) > 2350 then
9258
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   257
		return true
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   258
	end
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   259
	return false
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   260
end
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   261
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   262
function onHeroAtSaucerPosition(gear)
9328
811574013fed more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9326
diff changeset
   263
	if GetHealth(hero.gear) and GetX(gear) >= saucerX-25 and GetX(gear) <= saucerX+32 and GetY(gear) >= saucerY-32 and GetY(gear) <= saucerY+32 then
9258
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   264
		saucerAcquired = true
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   265
	end
9328
811574013fed more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9326
diff changeset
   266
	if saucerAcquired and GetHealth(hero.gear) and StoppedGear(gear) then
9258
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   267
		return true
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   268
	end
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   269
	return false
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   270
end
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   271
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   272
function onHeroOutOfGuardSight(gear)
9328
811574013fed more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9326
diff changeset
   273
	if GetHealth(hero.gear) and GetX(gear) < 3100 and GetY(gear) > saucerY-25 and StoppedGear(gear) and not guard1.keepTurning then
9258
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   274
		return true
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   275
	end
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   276
	return false
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   277
end
9328
811574013fed more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9326
diff changeset
   278
9266
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   279
function onMoonLanding(gear)
9328
811574013fed more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9326
diff changeset
   280
	if GetHealth(hero.gear) and GetX(gear) > 1010 and GetX(gear) < 1220  and GetY(gear) < 1300 and GetY(gear) > 750 and StoppedGear(gear) then
9266
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   281
		return true
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   282
	end
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   283
	return false
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   284
end
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   285
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   286
function onFruitPlanetLanding(gear)
9328
811574013fed more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9326
diff changeset
   287
	if GetHealth(hero.gear) and GetX(gear) > 2240 and GetX(gear) < 2540  and GetY(gear) < 1100 and StoppedGear(gear) then
9266
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   288
		return true
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   289
	end
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   290
	return false
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   291
end
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   292
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   293
function onDesertPlanetLanding(gear)
9328
811574013fed more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9326
diff changeset
   294
	if GetHealth(hero.gear) and GetX(gear) > 3568 and GetX(gear) < 4052  and GetY(gear) < 500 and StoppedGear(gear) then
9266
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   295
		return true
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   296
	end
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   297
	return false
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   298
end
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   299
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   300
function onIcePlanetLanding(gear)
9328
811574013fed more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9326
diff changeset
   301
	if GetHealth(hero.gear) and GetX(gear) > 1330 and GetX(gear) < 1650  and GetY(gear) < 500 and StoppedGear(gear) then
811574013fed more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9326
diff changeset
   302
		return true
811574013fed more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9326
diff changeset
   303
	end
811574013fed more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9326
diff changeset
   304
	return false
811574013fed more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9326
diff changeset
   305
end
811574013fed more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9326
diff changeset
   306
9572
278cff2a965f added death planet in cosmos without the order restriction yet
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9484
diff changeset
   307
function onDeathPlanetLanding(gear)
9637
b23f9b7d49fa added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9636
diff changeset
   308
	if GetHealth(hero.gear) and GetX(gear) > 280 and GetX(gear) < 700  and GetY(gear) < 720 and StoppedGear(gear) then
b23f9b7d49fa added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9636
diff changeset
   309
		return true
b23f9b7d49fa added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9636
diff changeset
   310
	end
b23f9b7d49fa added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9636
diff changeset
   311
	return false
b23f9b7d49fa added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9636
diff changeset
   312
end
b23f9b7d49fa added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9636
diff changeset
   313
b23f9b7d49fa added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9636
diff changeset
   314
function onMeteoriteLanding(gear)
b23f9b7d49fa added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9636
diff changeset
   315
	if GetHealth(hero.gear) and GetX(gear) > 2990 and GetX(gear) < 3395  and GetY(gear) < 940 and StoppedGear(gear) then
9572
278cff2a965f added death planet in cosmos without the order restriction yet
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9484
diff changeset
   316
		return true
278cff2a965f added death planet in cosmos without the order restriction yet
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9484
diff changeset
   317
	end
278cff2a965f added death planet in cosmos without the order restriction yet
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9484
diff changeset
   318
	return false
278cff2a965f added death planet in cosmos without the order restriction yet
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9484
diff changeset
   319
end
278cff2a965f added death planet in cosmos without the order restriction yet
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9484
diff changeset
   320
9328
811574013fed more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9326
diff changeset
   321
function onNoFuelAtLand(gear)
9758
3b8058b251b8 some more campaign string tweaks
sheepluva
parents: 9642
diff changeset
   322
	if checkPointReached > 1 and GetHealth(hero.gear) and GetY(gear) > 1400 and
9617
662956a081a0 fixed bug that didn't endgame when make wrong landing with no fuels
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9611
diff changeset
   323
			GetAmmoCount(gear, amJetpack) == 0 and StoppedGear(gear) then
9328
811574013fed more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9326
diff changeset
   324
		return true
811574013fed more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9326
diff changeset
   325
	end
811574013fed more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9326
diff changeset
   326
	return false
811574013fed more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9326
diff changeset
   327
end
811574013fed more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9326
diff changeset
   328
811574013fed more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9326
diff changeset
   329
function onHeroDeath(gear)
9617
662956a081a0 fixed bug that didn't endgame when make wrong landing with no fuels
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9611
diff changeset
   330
	if not GetHealth(hero.gear) then
9266
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   331
		return true
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   332
	end
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   333
	return false
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   334
end
9258
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   335
9639
6b2ae2eaf1b2 remove unnecessary comments
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9638
diff changeset
   336
-------------- ACTIONS ------------------
9258
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   337
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   338
function heroBeforeTreePosition(gear)
9574
da3d39667881 strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9572
diff changeset
   339
	AnimSay(gear,loc("Now I have to climb these trees"), SAY_SAY, 4000)
9258
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   340
	AnimCaption(hero.gear, loc("Use the rope to get to the crate"),  4000)
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   341
end
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   342
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   343
function heroAtSaucerPosition(gear)
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   344
	TurnTimeLeft = 0
9758
3b8058b251b8 some more campaign string tweaks
sheepluva
parents: 9642
diff changeset
   345
	-- save check point
9258
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   346
	SaveCampaignVar("CosmosCheckPoint", "2")
9617
662956a081a0 fixed bug that didn't endgame when make wrong landing with no fuels
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9611
diff changeset
   347
	checkPointReached = 2
9258
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   348
	AddAnim(dialog02)
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   349
	-- check if he was spotted by the guard
9619
f5fdb7770880 fix check for event - guard attack
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9618
diff changeset
   350
	if guard1.turn and GetX(hero.gear) > saucerX-150 then
9258
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   351
		guard1.keepTurning = false
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   352
		AddAnim(dialog03)
9758
3b8058b251b8 some more campaign string tweaks
sheepluva
parents: 9642
diff changeset
   353
	end
9258
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   354
end
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   355
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   356
function heroOutOfGuardSight(gear)
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   357
	guard1.keepTurning = true
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   358
	AddAnim(dialog04)
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   359
end
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   360
9266
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   361
function moonLanding(gear)
9585
d079e1cc2806 fixed bug in cosmos that permitted user to go to moon without collecting the saucer and removed ammo that was added for debug purposes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9584
diff changeset
   362
	if checkPointReached == 1 then
d079e1cc2806 fixed bug in cosmos that permitted user to go to moon without collecting the saucer and removed ammo that was added for debug purposes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9584
diff changeset
   363
		-- player climbed the moon with rope
d079e1cc2806 fixed bug in cosmos that permitted user to go to moon without collecting the saucer and removed ammo that was added for debug purposes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9584
diff changeset
   364
		FollowGear(doctor.gear)
d079e1cc2806 fixed bug in cosmos that permitted user to go to moon without collecting the saucer and removed ammo that was added for debug purposes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9584
diff changeset
   365
		AnimSay(doctor.gear, loc("One cannot simply walk in moon with rope!"), SAY_SHOUT, 4000)
9642
8a691e0f117a use consts for TStatInfo enum
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9640
diff changeset
   366
		SendStat(siGameResult, loc("This is the wrong way!"))
8a691e0f117a use consts for TStatInfo enum
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9640
diff changeset
   367
		SendStat(siCustomAchievement, loc("Collect the crate with the flying saucer"))
8a691e0f117a use consts for TStatInfo enum
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9640
diff changeset
   368
		SendStat(siCustomAchievement, loc("Fly to the moon"))
8a691e0f117a use consts for TStatInfo enum
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9640
diff changeset
   369
		SendStat(siPlayerKills,'0',teamC.name)
9585
d079e1cc2806 fixed bug in cosmos that permitted user to go to moon without collecting the saucer and removed ammo that was added for debug purposes
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9584
diff changeset
   370
		EndGame()
9589
20facc736354 cosmos corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9587
diff changeset
   371
	else
20facc736354 cosmos corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9587
diff changeset
   372
		if checkPointReached ~= 5 then
20facc736354 cosmos corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9587
diff changeset
   373
			SaveCampaignVar("CosmosCheckPoint", "4")
20facc736354 cosmos corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9587
diff changeset
   374
			SaveCampaignVar("HeroHealth",GetHealth(hero.gear))
20facc736354 cosmos corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9587
diff changeset
   375
		end
20facc736354 cosmos corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9587
diff changeset
   376
		AnimCaption(hero.gear,loc("Welcome to the moon!"))
9640
a6a903a6c2b3 some changes regarding hp save in cosmos and moon
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9639
diff changeset
   377
		SaveCampaignVar("HeroHealth", GetHealth(hero.gear))
9589
20facc736354 cosmos corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9587
diff changeset
   378
		SaveCampaignVar("Planet", "moon")
9611
ef374528a9fb moon side mission map and most of the logic
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9605
diff changeset
   379
		SaveCampaignVar("UnlockedMissions", "3")
9589
20facc736354 cosmos corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9587
diff changeset
   380
		SaveCampaignVar("Mission1", "2")
9611
ef374528a9fb moon side mission map and most of the logic
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9605
diff changeset
   381
		SaveCampaignVar("Mission2", "13")
ef374528a9fb moon side mission map and most of the logic
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9605
diff changeset
   382
		SaveCampaignVar("Mission3", "1")
9589
20facc736354 cosmos corrections
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9587
diff changeset
   383
		sendStats(loc("the moon"))
9326
689f591aa226 added saved hero health between missions
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9310
diff changeset
   384
	end
9266
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   385
end
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   386
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   387
function fruitPlanetLanding(gear)
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   388
	if checkPointReached < 5 then
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   389
		AddAnim(dialog06)
9758
3b8058b251b8 some more campaign string tweaks
sheepluva
parents: 9642
diff changeset
   390
	else
9574
da3d39667881 strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9572
diff changeset
   391
		AnimCaption(hero.gear,loc("Welcome to the Fruit Planet!"))
9484
a63307092bc6 fruit planet main mission first commit
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9467
diff changeset
   392
		SaveCampaignVar("Planet", "fruitPlanet")
9587
d6ddcafb1c56 fixed bug not displaying fuit02 after selecting fruitPlanet from cosmos
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9586
diff changeset
   393
		if status.fruit02 then
9590
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9589
diff changeset
   394
			SaveCampaignVar("UnlockedMissions", "4")
9587
d6ddcafb1c56 fixed bug not displaying fuit02 after selecting fruitPlanet from cosmos
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9586
diff changeset
   395
			SaveCampaignVar("Mission1", "3")
d6ddcafb1c56 fixed bug not displaying fuit02 after selecting fruitPlanet from cosmos
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9586
diff changeset
   396
			SaveCampaignVar("Mission2", "8")
9590
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9589
diff changeset
   397
			SaveCampaignVar("Mission3", "10")
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9589
diff changeset
   398
			SaveCampaignVar("Mission4", "1")
9587
d6ddcafb1c56 fixed bug not displaying fuit02 after selecting fruitPlanet from cosmos
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9586
diff changeset
   399
		else
9590
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9589
diff changeset
   400
			SaveCampaignVar("UnlockedMissions", "3")
9587
d6ddcafb1c56 fixed bug not displaying fuit02 after selecting fruitPlanet from cosmos
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9586
diff changeset
   401
			SaveCampaignVar("Mission1", "3")
9590
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9589
diff changeset
   402
			SaveCampaignVar("Mission2", "10")
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9589
diff changeset
   403
			SaveCampaignVar("Mission3", "1")
9587
d6ddcafb1c56 fixed bug not displaying fuit02 after selecting fruitPlanet from cosmos
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9586
diff changeset
   404
		end
9584
a7bf5464dfb6 add stats to cosmos
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9580
diff changeset
   405
		sendStats(loc("the Fruit Planet"))
9266
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   406
	end
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   407
end
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   408
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   409
function desertPlanetLanding(gear)
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   410
	if checkPointReached < 5 then
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   411
		AddAnim(dialog06)
9758
3b8058b251b8 some more campaign string tweaks
sheepluva
parents: 9642
diff changeset
   412
	else
9574
da3d39667881 strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9572
diff changeset
   413
		AnimCaption(hero.gear,loc("Welcome to the Desert Planet!"))
9404
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9342
diff changeset
   414
		SaveCampaignVar("Planet", "desertPlanet")
9605
66cd14e5bdad part of desert03 side mission - map not finished yet, will be commited later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9601
diff changeset
   415
		SaveCampaignVar("UnlockedMissions", "4")
9404
4ae9b399fa73 desert planet main mission addition - hwp will be added when fully finished
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9342
diff changeset
   416
		SaveCampaignVar("Mission1", "4")
9467
483a73697535 desert sidwquest map and basic script
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9457
diff changeset
   417
		SaveCampaignVar("Mission2", "7")
9605
66cd14e5bdad part of desert03 side mission - map not finished yet, will be commited later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9601
diff changeset
   418
		SaveCampaignVar("Mission3", "12")
66cd14e5bdad part of desert03 side mission - map not finished yet, will be commited later
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9601
diff changeset
   419
		SaveCampaignVar("Mission4", "1")
9584
a7bf5464dfb6 add stats to cosmos
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9580
diff changeset
   420
		sendStats(loc("the Desert Planet"))
9266
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   421
	end
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   422
end
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   423
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   424
function icePlanetLanding(gear)
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   425
	if checkPointReached < 5 then
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   426
		AddAnim(dialog06)
9342
51b5fffe3892 changes about displaying the ice planet mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9328
diff changeset
   427
	else
9574
da3d39667881 strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9572
diff changeset
   428
		AnimCaption(hero.gear,loc("Welcome to the Planet of Ice!"))
9342
51b5fffe3892 changes about displaying the ice planet mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9328
diff changeset
   429
		SaveCampaignVar("Planet", "icePlanet")
9457
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   430
		SaveCampaignVar("UnlockedMissions", "3")
9342
51b5fffe3892 changes about displaying the ice planet mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9328
diff changeset
   431
		SaveCampaignVar("Mission1", "5")
9455
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9404
diff changeset
   432
		SaveCampaignVar("Mission2", "6")
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9404
diff changeset
   433
		SaveCampaignVar("Mission3", "1")
9584
a7bf5464dfb6 add stats to cosmos
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9580
diff changeset
   434
		sendStats(loc("the Ice Planet"))
9266
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   435
	end
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   436
end
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   437
9572
278cff2a965f added death planet in cosmos without the order restriction yet
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9484
diff changeset
   438
function deathPlanetLanding(gear)
278cff2a965f added death planet in cosmos without the order restriction yet
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9484
diff changeset
   439
	if checkPointReached < 5 then
278cff2a965f added death planet in cosmos without the order restriction yet
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9484
diff changeset
   440
		AddAnim(dialog06)
9580
49db7a78c2bd fix typo in cosmos
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9578
diff changeset
   441
	elseif not (status.fruit02 and status.ice01 and status.desert01) then
9578
16139270448f save main missions' status
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9574
diff changeset
   442
		AddAnim(dialog07)
9572
278cff2a965f added death planet in cosmos without the order restriction yet
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9484
diff changeset
   443
	else
278cff2a965f added death planet in cosmos without the order restriction yet
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9484
diff changeset
   444
		AnimCaption(hero.gear,loc("Welcome to the Death Planet!"))
278cff2a965f added death planet in cosmos without the order restriction yet
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9484
diff changeset
   445
		SaveCampaignVar("Planet", "deathPlanet")
9601
6af4ca27421a added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9590
diff changeset
   446
		SaveCampaignVar("UnlockedMissions", "3")
9572
278cff2a965f added death planet in cosmos without the order restriction yet
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9484
diff changeset
   447
		SaveCampaignVar("Mission1", "9")
9601
6af4ca27421a added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9590
diff changeset
   448
		SaveCampaignVar("Mission2", "11")
6af4ca27421a added death planet side mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9590
diff changeset
   449
		SaveCampaignVar("Mission3", "1")
9584
a7bf5464dfb6 add stats to cosmos
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9580
diff changeset
   450
		sendStats(loc("the Planet of Death"))
9572
278cff2a965f added death planet in cosmos without the order restriction yet
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9484
diff changeset
   451
	end
278cff2a965f added death planet in cosmos without the order restriction yet
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9484
diff changeset
   452
end
278cff2a965f added death planet in cosmos without the order restriction yet
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9484
diff changeset
   453
9637
b23f9b7d49fa added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9636
diff changeset
   454
function meteoriteLanding(gear)
9640
a6a903a6c2b3 some changes regarding hp save in cosmos and moon
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9639
diff changeset
   455
	-- first two conditionals are not possible but I'll leave it there...
9637
b23f9b7d49fa added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9636
diff changeset
   456
	if checkPointReached < 5 then
b23f9b7d49fa added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9636
diff changeset
   457
		AddAnim(dialog06)
b23f9b7d49fa added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9636
diff changeset
   458
	elseif not (status.fruit02 and status.ice01 and status.desert01) then
b23f9b7d49fa added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9636
diff changeset
   459
		AddAnim(dialog07)
b23f9b7d49fa added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9636
diff changeset
   460
	else
b23f9b7d49fa added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9636
diff changeset
   461
		AnimCaption(hero.gear,loc("Welcome to the meteorite!"))
b23f9b7d49fa added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9636
diff changeset
   462
		SaveCampaignVar("Planet", "meteorite")
b23f9b7d49fa added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9636
diff changeset
   463
		SaveCampaignVar("UnlockedMissions", "2")
b23f9b7d49fa added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9636
diff changeset
   464
		SaveCampaignVar("Mission1", "14")
b23f9b7d49fa added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9636
diff changeset
   465
		SaveCampaignVar("Mission2", "1")
b23f9b7d49fa added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9636
diff changeset
   466
		sendStats(loc("the meteorite"))
b23f9b7d49fa added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9636
diff changeset
   467
	end
b23f9b7d49fa added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9636
diff changeset
   468
end
b23f9b7d49fa added event for meteorite mission
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9636
diff changeset
   469
9328
811574013fed more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9326
diff changeset
   470
function noFuelAtLand(gear)
811574013fed more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9326
diff changeset
   471
	AddAnim(dialog06)
811574013fed more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9326
diff changeset
   472
end
811574013fed more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9326
diff changeset
   473
811574013fed more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9326
diff changeset
   474
function heroDeath(gear)
9586
0b2494d87d99 stats in case player hasn't/can't reach a new destination
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9585
diff changeset
   475
	sendStatsOnRetry()
9328
811574013fed more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9326
diff changeset
   476
end
811574013fed more events in cosmos about GameEnd
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9326
diff changeset
   477
9802
00216d609140 desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9758
diff changeset
   478
function setFoundDeviceVisual()
00216d609140 desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9758
diff changeset
   479
	--WriteLnToConsole("status: "..status.fruit01.." - "..status.fruit02)
00216d609140 desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9758
diff changeset
   480
	if status.moon01 then
00216d609140 desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9758
diff changeset
   481
		vgear = AddVisualGear(1116, 848, vgtBeeTrace, 0, false)
00216d609140 desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9758
diff changeset
   482
00216d609140 desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9758
diff changeset
   483
	end
00216d609140 desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9758
diff changeset
   484
	if status.ice01 then
00216d609140 desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9758
diff changeset
   485
		vgear = AddVisualGear(1512, 120, vgtBeeTrace, 0, false)
00216d609140 desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9758
diff changeset
   486
00216d609140 desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9758
diff changeset
   487
	end
00216d609140 desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9758
diff changeset
   488
	if status.desert01 then
00216d609140 desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9758
diff changeset
   489
		vgear = AddVisualGear(4015, 316, vgtBeeTrace, 0, false)
00216d609140 desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9758
diff changeset
   490
00216d609140 desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9758
diff changeset
   491
	end
00216d609140 desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9758
diff changeset
   492
	if status.fruit01 and status.fruit02 then
00216d609140 desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9758
diff changeset
   493
		vgear = AddVisualGear(2390, 384, vgtBeeTrace, 0, false)
00216d609140 desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9758
diff changeset
   494
00216d609140 desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9758
diff changeset
   495
	end
00216d609140 desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9758
diff changeset
   496
	if status.death01 then
00216d609140 desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9758
diff changeset
   497
		vgear = AddVisualGear(444, 400, vgtBeeTrace, 0, false)
00216d609140 desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9758
diff changeset
   498
00216d609140 desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9758
diff changeset
   499
	end
00216d609140 desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9758
diff changeset
   500
	if status.final then
00216d609140 desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9758
diff changeset
   501
		vgear = AddVisualGear(3070, 810, vgtBeeTrace, 0, false)
00216d609140 desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9758
diff changeset
   502
00216d609140 desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9758
diff changeset
   503
	end
00216d609140 desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9758
diff changeset
   504
end
00216d609140 desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9758
diff changeset
   505
9258
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   506
-------------- ANIMATIONS ------------------
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   507
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   508
function Skipanim(anim)
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   509
	if goals[anim] ~= nil then
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   510
		ShowMission(unpack(goals[anim]))
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   511
    end
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   512
    if CurrentHedgehog ~= hero.gear and anim ~= dialog03 then
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   513
		AnimSwitchHog(hero.gear)
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   514
	elseif anim == dialog03 then
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   515
		startCombat()
9266
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   516
	elseif anim == dialog05 or anim == dialog06 then
9586
0b2494d87d99 stats in case player hasn't/can't reach a new destination
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9585
diff changeset
   517
		sendStatsOnRetry()
9258
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   518
	end
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   519
end
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   520
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   521
function AnimationSetup()
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   522
	-- DIALOG 01 - Start
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   523
	AddSkipFunction(dialog01, Skipanim, {dialog01})
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   524
	table.insert(dialog01, {func = AnimWait, args = {doctor.gear, 3000}})
9574
da3d39667881 strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9572
diff changeset
   525
	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Near secret base 17 of PAotH in the rural Hogland..."),  4000}})
9258
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   526
	table.insert(dialog01, {func = AnimSay, args = {director.gear, loc("So Hog Solo, here we are..."), SAY_SAY, 2000}})
9758
3b8058b251b8 some more campaign string tweaks
sheepluva
parents: 9642
diff changeset
   527
	table.insert(dialog01, {func = AnimSay, args = {director.gear, loc("Behind these trees on the east side there is secret base 17"), SAY_SAY, 4000}})
9258
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   528
	table.insert(dialog01, {func = AnimSay, args = {director.gear, loc("You have to continue alone from now on."), SAY_SAY, 3000}})
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   529
	table.insert(dialog01, {func = AnimSay, args = {director.gear, loc("Be careful, the future of Hogera is in your hands!"), SAY_SAY, 7200}})
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   530
	table.insert(dialog01, {func = AnimSay, args = {doctor.gear, loc("We'll use our communicators to contact you"), SAY_SAY, 2600}})
9574
da3d39667881 strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9572
diff changeset
   531
	table.insert(dialog01, {func = AnimSay, args = {doctor.gear, loc("In am also entrusting you with some rope"), SAY_SAY, 5000}})
da3d39667881 strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9572
diff changeset
   532
	table.insert(dialog01, {func = AnimSay, args = {doctor.gear, loc("You may find it handy"), SAY_SAY, 2300}})
9258
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   533
	table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("Thank you Dr.Cornelius"), SAY_SAY, 1600}})
9574
da3d39667881 strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9572
diff changeset
   534
	table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("I'll make good use of it"), SAY_SAY, 4500}})
da3d39667881 strings checked, all ok except ice02 that will be probably changed
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9572
diff changeset
   535
	table.insert(dialog01, {func = AnimSay, args = {director.gear, loc("It would be wiser to steal the space ship while PAotH guards are taking a brake!"), SAY_SAY, 7000}})
9258
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   536
	table.insert(dialog01, {func = AnimSay, args = {director.gear, loc("Remember! Many will seek the anti-gravity device! Now go, hurry up!"), SAY_SAY, 4000}})
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   537
	table.insert(dialog01, {func = AnimSwitchHog, args = {hero.gear}})
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   538
	-- DIALOG 02 - Hero got the saucer
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   539
	AddSkipFunction(dialog02, Skipanim, {dialog02})
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   540
	table.insert(dialog02, {func = AnimWait, args = {hero.gear, 500}})
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   541
	table.insert(dialog02, {func = AnimCaption, args = {hero.gear, loc("CheckPoint reached!"),  4000}})
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   542
	table.insert(dialog02, {func = AnimSay, args = {hero.gear, loc("Got the saucer!"), SAY_SHOUT, 2000}})
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   543
	table.insert(dialog02, {func = AnimSay, args = {director.gear, loc("Nice!"), SAY_SHOUT, 1000}})
9758
3b8058b251b8 some more campaign string tweaks
sheepluva
parents: 9642
diff changeset
   544
	table.insert(dialog02, {func = AnimSay, args = {director.gear, loc("Now use it and go to the moon PAotH station to get more fuel!"), SAY_SHOUT, 5000}})
9258
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   545
    table.insert(dialog02, {func = AnimGearWait, args = {hero.gear, 500}})
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   546
    -- DIALOG 03 - Hero got spotted by guard
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   547
	AddSkipFunction(dialog03, Skipanim, {dialog03})
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   548
	table.insert(dialog03, {func = AnimWait, args = {guard1.gear, 4000}})
9758
3b8058b251b8 some more campaign string tweaks
sheepluva
parents: 9642
diff changeset
   549
	table.insert(dialog03, {func = AnimCaption, args = {guard1.gear, loc("Prepare to flee!"),  4000}})
9258
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   550
	table.insert(dialog03, {func = AnimSay, args = {guard1.gear, loc("Hey").." "..guard2.name.."! "..loc("Look, someone is stealing the saucer!"), SAY_SHOUT, 4000}})
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   551
	table.insert(dialog03, {func = AnimSay, args = {guard2.gear, loc("I'll get him!"), SAY_SAY, 4000}})
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   552
	table.insert(dialog03, {func = startCombat, args = {guard1.gear}})
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   553
	-- DIALOG 04 - Hero out of sight
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   554
	AddSkipFunction(dialog04, Skipanim, {dialog04})
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   555
	table.insert(dialog04, {func = AnimCaption, args = {guard1.gear, loc("You are out of danger, time to go to the moon!"),  4000}})
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   556
	table.insert(dialog04, {func = AnimSay, args = {guard1.gear, loc("I guess we lost him!"), SAY_SAY, 3000}})
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   557
	table.insert(dialog04, {func = AnimSay, args = {guard2.gear, loc("We should better report this and continue our watch!"), SAY_SAY, 5000}})
9266
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   558
	table.insert(dialog04, {func = AnimSwitchHog, args = {hero.gear}})
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   559
	-- DIALOG 05 - Hero returned from moon without fuels
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   560
	AddSkipFunction(dialog05, Skipanim, {dialog05})
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   561
	table.insert(dialog05, {func = AnimSay, args = {hero.gear, loc("I guess I can't go far without fuels!"), SAY_THINK, 6000}})
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   562
	table.insert(dialog05, {func = AnimSay, args = {hero.gear, loc("Go to go back"), SAY_THINK, 2000}})
9586
0b2494d87d99 stats in case player hasn't/can't reach a new destination
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9585
diff changeset
   563
	table.insert(dialog05, {func = sendStatsOnRetry, args = {hero.gear}})
9266
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   564
	-- DIALOG 06 - Landing on wrong planet or on earth if not enough fuels
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   565
	AddSkipFunction(dialog06, Skipanim, {dialog06})
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   566
	table.insert(dialog06, {func = AnimCaption, args = {hero.gear, loc("You have to try again!"),  5000}})
9758
3b8058b251b8 some more campaign string tweaks
sheepluva
parents: 9642
diff changeset
   567
	table.insert(dialog06, {func = AnimSay, args = {hero.gear, loc("Hm... Now I ran out of fuel..."), SAY_THINK, 3000}})
9586
0b2494d87d99 stats in case player hasn't/can't reach a new destination
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9585
diff changeset
   568
	table.insert(dialog06, {func = sendStatsOnRetry, args = {hero.gear}})
9578
16139270448f save main missions' status
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9574
diff changeset
   569
	-- DIALOG 07 - Hero lands on Death Planet but isn't allowed yet to play this map
16139270448f save main missions' status
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9574
diff changeset
   570
	AddSkipFunction(dialog07, Skipanim, {dialog07})
16139270448f save main missions' status
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9574
diff changeset
   571
	table.insert(dialog07, {func = AnimCaption, args = {hero.gear, loc("This planet seems dangerous!"),  5000}})
9758
3b8058b251b8 some more campaign string tweaks
sheepluva
parents: 9642
diff changeset
   572
	table.insert(dialog07, {func = AnimSay, args = {hero.gear, loc("I am not ready for this planet yet. I should visit it when I have found all the other device parts"), SAY_THINK, 4000}})
9636
e1921235fc78 cosmos, after death01 dialogs
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9635
diff changeset
   573
	-- DIALOG 08 - Hero wins death01
e1921235fc78 cosmos, after death01 dialogs
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9635
diff changeset
   574
	AddSkipFunction(dialog08, Skipanim, {dialog08})
e1921235fc78 cosmos, after death01 dialogs
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9635
diff changeset
   575
	table.insert(dialog08, {func = AnimCaption, args = {hero.gear, loc("Under the meteorite shadow..."),  4000}})
e1921235fc78 cosmos, after death01 dialogs
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9635
diff changeset
   576
	table.insert(dialog08, {func = AnimSay, args = {doctor.gear, loc("You did great Hog Solo! However we aren't out of danger yet!"), SAY_SHOUT, 4500}})
9758
3b8058b251b8 some more campaign string tweaks
sheepluva
parents: 9642
diff changeset
   577
	table.insert(dialog08, {func = AnimSay, args = {doctor.gear, loc("The meteorite has come too close and the anti-gravity device isn't powerful enough to stop it now"), SAY_SHOUT, 5000}})
9636
e1921235fc78 cosmos, after death01 dialogs
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9635
diff changeset
   578
	table.insert(dialog08, {func = AnimSay, args = {doctor.gear, loc("We need it to get split into at least two parts"), SAY_SHOUT, 3000}})
e1921235fc78 cosmos, after death01 dialogs
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9635
diff changeset
   579
	table.insert(dialog08, {func = AnimSay, args = {doctor.gear, loc("PAotH has sent explosives but unfortunately the trigger mechanism seems to be faulty!"), SAY_SHOUT, 5000}})
e1921235fc78 cosmos, after death01 dialogs
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9635
diff changeset
   580
	table.insert(dialog08, {func = AnimSay, args = {doctor.gear, loc("We need you to go there and detonate them yourself! Good luck!"), SAY_SHOUT, 500}})
e1921235fc78 cosmos, after death01 dialogs
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9635
diff changeset
   581
	table.insert(dialog08, {func = AnimWait, args = {doctor.gear, 3000}})
e1921235fc78 cosmos, after death01 dialogs
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9635
diff changeset
   582
	table.insert(dialog08, {func = AnimSwitchHog, args = {hero.gear}})
9258
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   583
end
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   584
9266
199c1f066aad added landing event handlers for cosmos.lua
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9258
diff changeset
   585
------------------- custom "animation" functions --------------------------
9258
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   586
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   587
function startCombat()
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   588
	-- use this so guard2 will gain control
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   589
	AnimSwitchHog(hero.gear)
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   590
	TurnTimeLeft = 0
5c760ed50b3d first commit, added cosmos(menu) map and lua script with some functionality
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   591
end
9584
a7bf5464dfb6 add stats to cosmos
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9580
diff changeset
   592
a7bf5464dfb6 add stats to cosmos
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9580
diff changeset
   593
function sendStats(planet)
9758
3b8058b251b8 some more campaign string tweaks
sheepluva
parents: 9642
diff changeset
   594
	SendStat(siGameResult, loc("Hog Solo arrived at "..planet))
9642
8a691e0f117a use consts for TStatInfo enum
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9640
diff changeset
   595
	SendStat(siCustomAchievement, loc("Return to the mission menu by pressing the \"Go back\" button"))
9758
3b8058b251b8 some more campaign string tweaks
sheepluva
parents: 9642
diff changeset
   596
	SendStat(siCustomAchievement, loc("You can choose another planet by replaying this mission"))
9802
00216d609140 desert01 fixed destructible terrain marks and cosmos marks for completed main missions
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9758
diff changeset
   597
	SendStat(siCustomAchievement, loc("Planets with completed main missions will be marked with a flower"))
9642
8a691e0f117a use consts for TStatInfo enum
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9640
diff changeset
   598
	SendStat(siPlayerKills,'1',teamC.name)
9584
a7bf5464dfb6 add stats to cosmos
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9580
diff changeset
   599
	EndGame()
a7bf5464dfb6 add stats to cosmos
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9580
diff changeset
   600
end
9586
0b2494d87d99 stats in case player hasn't/can't reach a new destination
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9585
diff changeset
   601
0b2494d87d99 stats in case player hasn't/can't reach a new destination
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9585
diff changeset
   602
function sendStatsOnRetry()
9642
8a691e0f117a use consts for TStatInfo enum
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9640
diff changeset
   603
	SendStat(siGameResult, loc("You have to travel again"))
9758
3b8058b251b8 some more campaign string tweaks
sheepluva
parents: 9642
diff changeset
   604
	SendStat(siCustomAchievement, loc("Your first destination is the moon in order to get more fuel"))
3b8058b251b8 some more campaign string tweaks
sheepluva
parents: 9642
diff changeset
   605
	SendStat(siCustomAchievement, loc("You have to complete the main mission on moon in order to travel to other planets"))
9642
8a691e0f117a use consts for TStatInfo enum
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9640
diff changeset
   606
	SendStat(siCustomAchievement, loc("You have to be careful and not die!"))
8a691e0f117a use consts for TStatInfo enum
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9640
diff changeset
   607
	SendStat(siPlayerKills,'0',teamC.name)
9586
0b2494d87d99 stats in case player hasn't/can't reach a new destination
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9585
diff changeset
   608
	EndGame()
0b2494d87d99 stats in case player hasn't/can't reach a new destination
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9585
diff changeset
   609
end