share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/fruit03.lua
author Periklis Ntanasis <pntanasis@gmail.com>
Thu, 29 Aug 2013 08:04:10 +0300
branchspacecampaign
changeset 9590 347e799f01de
child 9591 b7870f018e5f
permissions -rw-r--r--
fruit side mission map and some logic
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9590
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     1
------------------- ABOUT ----------------------
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     2
--
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     3
-- Hero has get into an Red Strawberies ambush
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     4
-- He has to eliminate the enemies by using limited
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     5
-- ammo of sniper rifle and watermelon
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     6
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     7
HedgewarsScriptLoad("/Scripts/Locale.lua")
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     8
HedgewarsScriptLoad("/Scripts/Animate.lua")
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
     9
HedgewarsScriptLoad("/Missions/Campaign/A_Space_Adventure/global_functions.lua")
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    10
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    11
----------------- VARIABLES --------------------
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    12
-- globals
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    13
local missionName = loc("Precise shooting")
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    14
-- hogs
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    15
local hero = {
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    16
	name = loc("Hog Solo"),
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    17
	x = 1830,
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    18
	y = 560,
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    19
	dead = false
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    20
}
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    21
local enemiesOdd = {
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    22
	{name = "Hog 1", x = 3670 , y = 175},
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    23
	{name = "Hog 3", x = 3795 , y = 1110},
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    24
	{name = "Hog 5", x = 1950 , y = 1480},
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    25
	{name = "Hog 7", x = 400 , y = 920},
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    26
	{name = "Hog 9", x = 1100 , y = 1950},
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    27
	{name = "Hog 11", x = 1200 , y = 1950},
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    28
	{name = "Hog 13", x = 2300 , y = 1950},
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    29
	{name = "Hog 15", x = 2400 , y = 1950},
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    30
}
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    31
local enemiesEven = {
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    32
	{name = "Hog 2", x = 660, y = 170},
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    33
	{name = "Hog 4", x = 1900, y = 1320},
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    34
	{name = "Hog 6", x = 2030, y = 1335},
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    35
	{name = "Hog 8", x = 1300, y = 1950},
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    36
	{name = "Hog 10", x = 1400, y = 1950},
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    37
	{name = "Hog 12", x = 2500, y = 1950},
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    38
	{name = "Hog 14", x = 2600, y = 1950},
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    39
	{name = "Hog 16", x = 1850, y = 560},
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    40
}
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    41
-- teams
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    42
local teamA = {
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    43
	name = loc("Hog Solo"),
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    44
	color = tonumber("38D61C",16) -- green
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    45
}
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    46
local teamB = {
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    47
	name = loc("RS1"),
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    48
	color = tonumber("FF0000",16) -- red
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    49
}
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    50
local teamC = {
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    51
	name = loc("RS2"),
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    52
	color = tonumber("FF0000",16) -- red
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    53
}
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    54
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    55
-------------- LuaAPI EVENT HANDLERS ------------------
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    56
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    57
function onGameInit()
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    58
	GameFlags = gfDisableWind + gfInfAttack
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    59
	Seed = 1
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    60
	TurnTime = 25000
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    61
	CaseFreq = 0
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    62
	MinesNum = 0
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    63
	MinesTime = 1
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    64
	Explosives = 0
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    65
	Map = "fruit03_map"
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    66
	Theme = "Fruit"
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    67
	
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    68
	-- Hog Solo
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    69
	AddTeam(teamA.name, teamA.color, "Bone", "Island", "HillBilly", "cm_birdy")
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    70
	hero.gear = AddHog(hero.name, 0, 100, "war_desertgrenadier1")
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    71
	AnimSetGearPosition(hero.gear, hero.x, hero.y)
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    72
	-- enemies
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    73
	AddTeam(teamC.name, teamC.color, "Bone", "Island", "HillBilly", "cm_birdy")
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    74
	for i=1,table.getn(enemiesEven) do
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    75
		enemiesEven[i].gear = AddHog(enemiesEven[i].name, 1, 100, "war_desertgrenadier1")
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    76
		AnimSetGearPosition(enemiesEven[i].gear, enemiesEven[i].x, enemiesEven[i].y)
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    77
	end	
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    78
	AddTeam(teamB.name, teamB.color, "Bone", "Island", "HillBilly", "cm_birdy")
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    79
	for i=1,table.getn(enemiesOdd) do
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    80
		enemiesOdd[i].gear = AddHog(enemiesOdd[i].name, 1, 100, "war_desertgrenadier1")
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    81
		AnimSetGearPosition(enemiesOdd[i].gear, enemiesOdd[i].x, enemiesOdd[i].y)
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    82
	end
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    83
	
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    84
	initCheckpoint("fruit03")
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    85
	
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    86
	AnimInit()
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    87
	--AnimationSetup()
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    88
end
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    89
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    90
function onGameStart()
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    91
	AnimWait(hero.gear, 3000)
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    92
	FollowGear(hero.gear)
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    93
	
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    94
	AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0)
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    95
	
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    96
	--hero ammo
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    97
	AddAmmo(hero.gear, amTeleport, 2)
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    98
	AddAmmo(hero.gear, amSniperRifle, 2)
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
    99
	AddAmmo(hero.gear, amWatermelon, 2)
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   100
	--enemies ammo
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   101
	AddAmmo(enemiesOdd[1].gear, amSniperRifle, 100)
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   102
	AddAmmo(enemiesOdd[1].gear, amWatermelon, 1)
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   103
	AddAmmo(enemiesEven[1].gear, amSniperRifle, 100)
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   104
	AddAmmo(enemiesEven[1].gear, amWatermelon, 1)
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   105
	
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   106
	SendHealthStatsOff()
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   107
end
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   108
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   109
function onGameTick20()
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   110
	turnHogs()
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   111
end
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   112
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   113
function onGearDelete(gear)
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   114
	if gear == hero.gear then
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   115
		hero.dead = true
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   116
	end
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   117
end
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   118
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   119
-------------- EVENTS ------------------
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   120
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   121
function onHeroDeath(gear)
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   122
	if hero.dead then
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   123
		return true
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   124
	end
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   125
	return false
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   126
end
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   127
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   128
-------------- ACTIONS ------------------
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   129
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   130
-- game ends anyway but I want to sent custom stats probably...
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   131
function heroDeath(gear)
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   132
	heroLost()
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   133
end
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   134
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   135
------------------ Other Functions -------------------
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   136
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   137
function turnHogs()
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   138
	for i=1,table.getn(enemiesEven) do
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   139
		if GetHealth(enemiesEven[i].gear) then
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   140
			if GetX(enemiesEven[i].gear) < GetX(hero.gear) then
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   141
				HogTurnLeft(enemiesEven[i].gear, false)
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   142
			elseif GetX(enemiesEven[i].gear) > GetX(hero.gear) then
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   143
				HogTurnLeft(enemiesEven[i].gear, true)
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   144
			end
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   145
		end
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   146
	end
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   147
	for i=1,table.getn(enemiesOdd) do
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   148
		if GetHealth(enemiesOdd[i].gear) then
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   149
			if GetX(enemiesOdd[i].gear) < GetX(hero.gear) then
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   150
				HogTurnLeft(enemiesOdd[i].gear, false)
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   151
			elseif GetX(enemiesOdd[i].gear) > GetX(hero.gear) then
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   152
				HogTurnLeft(enemiesOdd[i].gear, true)
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   153
			end
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   154
		end
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   155
	end
347e799f01de fruit side mission map and some logic
Periklis Ntanasis <pntanasis@gmail.com>
parents:
diff changeset
   156
end