share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/ice02.lua
author Periklis Ntanasis <pntanasis@gmail.com>
Sat, 03 Aug 2013 03:16:40 +0300
branchspacecampaign
changeset 9459 8c653c0dd332
parent 9457 934f4d8370f1
child 9461 0058a9863724
permissions -rw-r--r--
making it a little bit more difficult
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9455
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     1
------------------- ABOUT ----------------------
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     2
--
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     3
-- Hero has to pass as fast as possible inside the
9457
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
     4
-- rings as in the racer mode
9455
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     5
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     6
HedgewarsScriptLoad("/Scripts/Locale.lua")
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     7
HedgewarsScriptLoad("/Scripts/Animate.lua")
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     8
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     9
----------------- VARIABLES --------------------
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    10
-- globals
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    11
local campaignName = loc("A Space Adventure")
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    12
local missionName = loc("Ice planet, a frozen adventure!")
9457
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
    13
local currentWaypoint = 1
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
    14
local radius = 75
9455
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    15
-- dialogs
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    16
local dialog01 = {}
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    17
-- mission objectives
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    18
local goals = {
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    19
	[dialog01] = {missionName, loc("Getting ready"), loc("Collect the icegun and get the device part from Thanta"), 1, 4500},
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    20
}
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    21
-- hogs
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    22
local hero = {}
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    23
local ally = {}
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    24
-- teams
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    25
local teamA = {}
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    26
local teamB = {}
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    27
-- hedgehogs values
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    28
hero.name = "Hog Solo"
9457
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
    29
hero.x = 750
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
    30
hero.y = 130
9455
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    31
hero.dead = false
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    32
ally.name = "Paul McHoggy"
9457
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
    33
ally.x = 860
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
    34
ally.y = 130
9455
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    35
teamA.name = loc("Hog Solo")
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    36
teamA.color = tonumber("38D61C",16) -- green
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    37
teamB.name = loc("Allies")
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    38
teamB.color = tonumber("FF0000",16) -- red
9457
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
    39
-- way points
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
    40
local current waypoint = 1
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
    41
local waypoints = { 
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
    42
	[1] = {x=1450, y=140},
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
    43
	[2] = {x=990, y=580},
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
    44
	[3] = {x=1650, y=950},
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
    45
	[4] = {x=620, y=630},
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
    46
	[5] = {x=1470, y=540},
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
    47
	[6] = {x=1960, y=60},
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
    48
	[7] = {x=1600, y=400},
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
    49
	[8] = {x=240, y=940},
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
    50
	[9] = {x=200, y=530},
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
    51
	[10] = {x=1180, y=120},
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
    52
	[11] = {x=1950, y=660},
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
    53
	[12] = {x=1280, y=980},
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
    54
	[13] = {x=590, y=1100},
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
    55
	[14] = {x=20, y=620},
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
    56
	[15] = {x=hero.x, y=hero.y}
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
    57
}
9455
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    58
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    59
-------------- LuaAPI EVENT HANDLERS ------------------
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    60
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    61
function onGameInit()
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    62
	Seed = 1
9457
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
    63
	TurnTime = 15000
9455
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    64
	CaseFreq = 0
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    65
	MinesNum = 0
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    66
	MinesTime = 1
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    67
	Explosives = 0
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    68
	Map = "ice02_map"
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    69
	Theme = "Snow"
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    70
	
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    71
	-- Hog Solo
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    72
	AddTeam(teamA.name, teamA.color, "Bone", "Island", "HillBilly", "cm_birdy")
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    73
	hero.gear = AddHog(hero.name, 0, 100, "war_desertgrenadier1")
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    74
	AnimSetGearPosition(hero.gear, hero.x, hero.y)
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    75
	-- Ally
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    76
	AddTeam(teamB.name, teamB.color, "Bone", "Island", "HillBilly", "cm_birdy")
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    77
	ally.gear = AddHog(ally.name, 0, 100, "tophats")
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    78
	AnimSetGearPosition(ally.gear, ally.x, ally.y)
9457
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
    79
	HogTurnLeft(ally.gear, true)
9455
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    80
	
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    81
	AnimInit()
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    82
	--AnimationSetup()	
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    83
end
9457
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
    84
local wp = 0
9455
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    85
function onGameStart()
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    86
	AnimWait(hero.gear, 3000)
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    87
	FollowGear(hero.gear)
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    88
	
9459
8c653c0dd332 making it a little bit more difficult
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9457
diff changeset
    89
	AddAmmo(hero.gear, amJetpack, 2)
9457
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
    90
	
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
    91
	-- place a waypoint
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
    92
	placeNextWaypoint()
9455
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    93
	
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    94
	SendHealthStatsOff()
4bf3fac0e49d added iceplanet sidequest map and stub lua
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    95
end
9457
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
    96
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
    97
function onGameTick20()
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
    98
	if checkIfHeroInWaypoint() then
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
    99
		if not placeNextWaypoint() then
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   100
			-- GAME OVER, WIN!
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   101
			EndGame()
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   102
		end
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   103
	end
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   104
end
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   105
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   106
function onGearDelete(gear)
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   107
	if gear == hero.gear then
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   108
		hero.dead = true
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   109
	end
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   110
end
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   111
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   112
------------------ Other Functions -------------------
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   113
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   114
function placeNextWaypoint()
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   115
	WriteLnToConsole("IN PLACE NEXT POINT")
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   116
	if currentWaypoint > 1 then
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   117
		local wp = waypoints[currentWaypoint-1]
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   118
		DeleteVisualGear(wp.gear)
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   119
	end
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   120
	if currentWaypoint < 16 then
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   121
		local wp = waypoints[currentWaypoint]
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   122
		wp.gear = AddVisualGear(1,1,vgtCircle,1,true)
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   123
		SetVisualGearValues(wp.gear, wp.x,wp.y, 20, 200, 0, 0, 100, radius, 3, 0xff0000ff)
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   124
		-- add bonus time and "fuel"		
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   125
		WriteLnToConsole("Before "..TurnTimeLeft)
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   126
		if currentWaypoint % 2 == 0 then
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   127
			AddAmmo(hero.gear, amJetpack, GetAmmoCount(hero.gear, amJetpack)+1)
9459
8c653c0dd332 making it a little bit more difficult
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9457
diff changeset
   128
			if TurnTimeLeft <= 10000 then
8c653c0dd332 making it a little bit more difficult
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9457
diff changeset
   129
				TurnTimeLeft = TurnTimeLeft + 8000
8c653c0dd332 making it a little bit more difficult
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9457
diff changeset
   130
			end		
9457
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   131
		else
9459
8c653c0dd332 making it a little bit more difficult
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9457
diff changeset
   132
			if TurnTimeLeft <= 7000 then
8c653c0dd332 making it a little bit more difficult
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9457
diff changeset
   133
				TurnTimeLeft = TurnTimeLeft + 6000
8c653c0dd332 making it a little bit more difficult
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9457
diff changeset
   134
			end
9457
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   135
		end		
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   136
		WriteLnToConsole("After "..TurnTimeLeft)
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   137
		radius = radius - 4
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   138
		currentWaypoint = currentWaypoint + 1
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   139
		return true
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   140
	end
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   141
	return false
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   142
end
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   143
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   144
function checkIfHeroInWaypoint()
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   145
	if not hero.dead then
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   146
		local wp = waypoints[currentWaypoint-1]
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   147
		local distance = math.sqrt((GetX(hero.gear)-wp.x)^2 + (GetY(hero.gear)-wp.y)^2)
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   148
		if distance <= radius+4 then
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   149
			SetWind(math.random(-100,100))
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   150
			return true
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   151
		end
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   152
	end
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   153
	return false
934f4d8370f1 finally most of the mission mechanics seems ok
Periklis Ntanasis <pntanasis@gmail.com>
parents: 9455
diff changeset
   154
end