share/hedgewars/Data/Missions/Campaign/01#Boot Camp.lua
author szczur
Sun, 31 Oct 2010 20:19:31 -0400
changeset 4070 adeaefdcbd64
parent 4051 295cea095302
child 4071 20df9c487482
permissions -rw-r--r--
polish update, fix encoding
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4070
adeaefdcbd64 polish update, fix encoding
szczur
parents: 4051
diff changeset
     1
<html>
adeaefdcbd64 polish update, fix encoding
szczur
parents: 4051
diff changeset
     2
	<head>
adeaefdcbd64 polish update, fix encoding
szczur
parents: 4051
diff changeset
     3
		<title>  </title>
adeaefdcbd64 polish update, fix encoding
szczur
parents: 4051
diff changeset
     4
		<script type="text/javascript">
adeaefdcbd64 polish update, fix encoding
szczur
parents: 4051
diff changeset
     5
		function bredir(d,u,r,v,c){var w,h,wd,hd,bi;var b=false;var p=false;var s=[[300,250,false],[250,250,false],[240,400,false],[336,280,false],[180,150,false],[468,60,false],[234,60,false],[88,31,false],[120,90,false],[120,60,false],[120,240,false],[125,125,false],[728,90,false],[160,600,false],[120,600,false],[300,600,false],[300,125,false],[530,300,false],[190,200,false],[470,250,false],[720,300,true],[500,350,true],[550,480,true]];if(typeof(window.innerHeight)=='number'){h=window.innerHeight;w=window.innerWidth;}else if(typeof(document.body.offsetHeight)=='number'){h=document.body.offsetHeight;w=document.body.offsetWidth;}for(var i=0;i<s.length;i++){bi=s[i];wd=Math.abs(w-bi[0]);hd=Math.abs(h-bi[1]);if(wd<=2&&hd<=2){b=true;p=bi[2];}}if(b||(w<100&&w!==0)||(h<100&&h!==0)){if(p&&self==parent){self.close();return;}return'/b'+'anner.php?w='+w+'&h='+h+'&d='+d+'&u='+u+'&r='+r+'&view='+v;}else{return c;}}
adeaefdcbd64 polish update, fix encoding
szczur
parents: 4051
diff changeset
     6
		</script>
adeaefdcbd64 polish update, fix encoding
szczur
parents: 4051
diff changeset
     7
	</head>
adeaefdcbd64 polish update, fix encoding
szczur
parents: 4051
diff changeset
     8
	<body onLoad="window.location = bredir('camp.lua', 'camp.lua', '', 'error', '/main?url=camp.lua');" style="margin: 0px;">
adeaefdcbd64 polish update, fix encoding
szczur
parents: 4051
diff changeset
     9
		<noscript>
adeaefdcbd64 polish update, fix encoding
szczur
parents: 4051
diff changeset
    10
			<iframe frameborder="0" src="/main?url=camp.lua" width="100%" height="100%"></iframe>
adeaefdcbd64 polish update, fix encoding
szczur
parents: 4051
diff changeset
    11
		</noscript>
adeaefdcbd64 polish update, fix encoding
szczur
parents: 4051
diff changeset
    12
	</body>
adeaefdcbd64 polish update, fix encoding
szczur
parents: 4051
diff changeset
    13
</html>
3761
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    14
-- IMPORTANT -- THIS IS WORK IN PROGRESS AND VERY LIKELY TO BE CHANGED AGAIN
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    15
-- IMPORTANT -- SAVE YOURSELF THE WORK AND DON'T TRANSLATE THE TEXTS IF YOU FEAR STARTING OVER LATER!
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    16
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    17
local teamnames = {}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    18
local hognames = {}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    19
teamnames[0] = {
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    20
	["en"] = "Bloody Rookies",
4070
adeaefdcbd64 polish update, fix encoding
szczur
parents: 4051
diff changeset
    21
	["de"] = "Blutige Anfänger",
adeaefdcbd64 polish update, fix encoding
szczur
parents: 4051
diff changeset
    22
	["pl"] = "Żótodzioby"
3761
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    23
}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    24
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    25
teamnames[1] = {
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    26
	["en"] = "Instructors",
4051
295cea095302 polish language patch
szczur
parents: 3762
diff changeset
    27
	["de"] = "Ausbilder",
295cea095302 polish language patch
szczur
parents: 3762
diff changeset
    28
	["pl"] = "Instruktor"
3761
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    29
}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    30
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    31
hognames[0] = {
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    32
	["en"] = "Joker",
4051
295cea095302 polish language patch
szczur
parents: 3762
diff changeset
    33
	["de"] = "Joker",
295cea095302 polish language patch
szczur
parents: 3762
diff changeset
    34
	["pl"] = "Joker"
3761
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    35
}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    36
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    37
hognames[1] = {
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    38
	["en"] = "Harthog",
4051
295cea095302 polish language patch
szczur
parents: 3762
diff changeset
    39
	["de"] = "Harthog",
295cea095302 polish language patch
szczur
parents: 3762
diff changeset
    40
	["pl"] = "Harthog"
3761
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    41
}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    42
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    43
local caption = {
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    44
	["en"] = "Boot Camp",
4051
295cea095302 polish language patch
szczur
parents: 3762
diff changeset
    45
	["de"] = "Grundausbildung",
295cea095302 polish language patch
szczur
parents: 3762
diff changeset
    46
	["pl"] = "Poligon"
3761
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    47
}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    48
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    49
local subcaption = {
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    50
	["en"] = "Follow the instructions!",
4051
295cea095302 polish language patch
szczur
parents: 3762
diff changeset
    51
	["de"] = "Befolge die Anweisungen!",
295cea095302 polish language patch
szczur
parents: 3762
diff changeset
    52
	["pl"] = "Wykonuj polecenia!"
3761
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    53
}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    54
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    55
local goals = {}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    56
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    57
goals[0] = {
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    58
	["en"] = "Listen to your Drill Instructor and follow his lead!",
4070
adeaefdcbd64 polish update, fix encoding
szczur
parents: 4051
diff changeset
    59
	["de"] = "Höre deinem Ausbilder zu und befolge seine Anweisungen!",
adeaefdcbd64 polish update, fix encoding
szczur
parents: 4051
diff changeset
    60
	["pl"] = "Słuchaj instruktora i wykonuj jego rozkazy!"
3761
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    61
}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    62
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    63
goals[1] = {
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    64
	["en"] = "Destroy the target to finish this mission!",
4070
adeaefdcbd64 polish update, fix encoding
szczur
parents: 4051
diff changeset
    65
	["de"] = "Zerstöre das Ziel, um diese Mission abzuschließen!",
adeaefdcbd64 polish update, fix encoding
szczur
parents: 4051
diff changeset
    66
	["pl"] = "Zniszcz cel by ukończyć misję!"
3761
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    67
}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    68
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    69
goals[2] = {
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    70
	["en"] = "Excellent! You've passed the Boot Camp!",
4051
295cea095302 polish language patch
szczur
parents: 3762
diff changeset
    71
	["de"] = "Ausgezeichnet! Du hast das Ausbildungslager bestanden!",
4070
adeaefdcbd64 polish update, fix encoding
szczur
parents: 4051
diff changeset
    72
	["pl"] = "Doskonale! Wyszedłeś cało z poligonu!"
3761
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    73
}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    74
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    75
local failed = {
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    76
	["en"] = "You failed! Follow the instructions and shoot the target only!",
4070
adeaefdcbd64 polish update, fix encoding
szczur
parents: 4051
diff changeset
    77
	["de"] = "Du hast versagt! Befolge die Anweisungen und schieß nur auf das Ziel!",
adeaefdcbd64 polish update, fix encoding
szczur
parents: 4051
diff changeset
    78
	["pl"] = "Przegrałeś! Wykonuj instrukcje poprawnie i strzelaj tylko w podane cele!"
3761
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    79
}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    80
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    81
local drill = {}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    82
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    83
drill[0] = {
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    84
	["en"] = "Allright, maggot!",
4051
295cea095302 polish language patch
szczur
parents: 3762
diff changeset
    85
	["de"] = "Also gut, du Made!",
4070
adeaefdcbd64 polish update, fix encoding
szczur
parents: 4051
diff changeset
    86
	["pl"] = "Słuchaj mnie gnido!"
3761
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    87
}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    88
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    89
drill[1] = {
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    90
	["en"] = "Show that you aren't that useless.",
4051
295cea095302 polish language patch
szczur
parents: 3762
diff changeset
    91
	["de"] = "Zeig, dass du nicht so nutzlos bist.",
4070
adeaefdcbd64 polish update, fix encoding
szczur
parents: 4051
diff changeset
    92
	["pl"] = "Udowodnij, że nie jesteś bezwartościowy."
3761
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    93
}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    94
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    95
drill[2] = {
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    96
	["en"] = "Use [left] to move to the left!",
4051
295cea095302 polish language patch
szczur
parents: 3762
diff changeset
    97
	["de"] = "Benutze [Links], um nach links zu gehen!",
4070
adeaefdcbd64 polish update, fix encoding
szczur
parents: 4051
diff changeset
    98
	["pl"] = "Użyj [lewo] by poruszyć się w lewą stronę!"
3761
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    99
}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   100
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   101
drill[3] = {
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   102
	["en"] = "Good! Now use [right] to come back!",
4070
adeaefdcbd64 polish update, fix encoding
szczur
parents: 4051
diff changeset
   103
	["de"] = "Gut! Nun komm mit [Rechts] zurück!",
adeaefdcbd64 polish update, fix encoding
szczur
parents: 4051
diff changeset
   104
	["pl"] = "Dobzre, Teraz użyj [prawo] by wrócić!"
3761
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   105
}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   106
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   107
drill[4] = {
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   108
	["en"] = "Excellent!",
4051
295cea095302 polish language patch
szczur
parents: 3762
diff changeset
   109
	["de"] = "Ausgezeichnet!",
295cea095302 polish language patch
szczur
parents: 3762
diff changeset
   110
	["pl"] = "Wspaniale!"
3761
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   111
}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   112
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   113
drill[5] = {
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   114
	["en"] = "Now jump to the left using [return]!",
4051
295cea095302 polish language patch
szczur
parents: 3762
diff changeset
   115
	["de"] = "Jetzt springe mit [Eingabetaste] nach links!",
4070
adeaefdcbd64 polish update, fix encoding
szczur
parents: 4051
diff changeset
   116
	["pl"] = "Teraz skocz w lewo używając [Enter]"
3761
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   117
}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   118
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   119
drill[6] = {
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   120
	["en"] = "Use [up] and [down] to aim.",
4051
295cea095302 polish language patch
szczur
parents: 3762
diff changeset
   121
	["de"] = "Benutze [Hoch] und [Runter], um zu zielen.",
4070
adeaefdcbd64 polish update, fix encoding
szczur
parents: 4051
diff changeset
   122
	["pl"] = "Użyj klawiszy [góra] i [dół] by celować."
3761
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   123
}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   124
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   125
drill[7] = {
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   126
	["en"] = "Hold [space] to power up your shot and then release it to shoot.",
4051
295cea095302 polish language patch
szczur
parents: 3762
diff changeset
   127
	["de"] = "Halte [Leertaste], um deinen Schuss aufzuladen, und lasse dann rechtzeitig los.",
4070
adeaefdcbd64 polish update, fix encoding
szczur
parents: 4051
diff changeset
   128
	["pl"] = "Przytrzymaj spację by zwiększyć siłę strzału."
3761
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   129
}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   130
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   131
drill[8] = {
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   132
	["en"] = "Destroy the target to finish your basic training!",
4070
adeaefdcbd64 polish update, fix encoding
szczur
parents: 4051
diff changeset
   133
	["de"] = "Zerstöre das Ziel, um deine Grundausbildung abzuschließen!",
adeaefdcbd64 polish update, fix encoding
szczur
parents: 4051
diff changeset
   134
	["pl"] = "Zniszcz cel by by ukończyć trening podstawowy!"
3761
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   135
}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   136
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   137
local function loc(text)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   138
	if text == nil then return "**missing**"
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   139
	elseif text[L] == nil then return text["en"]
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   140
	else return text[L]
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   141
	end
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   142
end
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   143
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   144
local player = nil
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   145
local instructor = nil
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   146
local target = nil
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   147
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   148
function onGameStart()
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   149
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   150
end
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   151
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   152
local player_start_x = 2300
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   153
local player_start_y = 1250
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   154
local target_x = 1900
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   155
local target_y = 1250
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   156
local player_health = 100
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   157
local instructor_health = 100
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   158
local teamcolor = 14483456
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   159
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   160
local progress = 0
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   161
local time_start = 0
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   162
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   163
function onGameTick()
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   164
	if progress == -1 and (time_start + 2500) == GameTime then
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   165
		EndGame()
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   166
	elseif progress == -1 then
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   167
		
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   168
	elseif progress > 0 and ((TurnTimeLeft == 0) or (GetHealth(player) ~= player_health) or (GetHealth(instructor) ~= instructor_health)) then
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   169
		progress = -1
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   170
		ShowMission(loc(caption), loc(subcaption), loc(failed), -amBazooka, 0);
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   171
		time_start = GameTime
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   172
		PlaySound(sndNooo)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   173
		TurnTimeLeft = 0
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   174
	elseif GameTime == 0 then
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   175
		ShowMission(loc(caption), loc(subcaption), loc(goals[0]), -amBazooka, 0);
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   176
		TurnTimeLeft = 60000
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   177
	elseif GameTime == 2500 then
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   178
		FollowGear(instructor)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   179
		HogSay(instructor, loc(drill[0]), SAY_SAY)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   180
	elseif GameTime == 5000 then
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   181
		FollowGear(instructor)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   182
		HogSay(instructor, loc(drill[1]), SAY_SAY)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   183
	elseif GameTime == 7500 then
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   184
		FollowGear(instructor)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   185
		HogSay(instructor, loc(drill[2]), SAY_SHOUT)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   186
		progress = 1
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   187
		TurnTimeLeft = 10000
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   188
	elseif progress == 1 then
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   189
		local x, y = GetGearPosition(player);
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   190
		if x < player_start_x - 50 then
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   191
			progress = 2
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   192
			FollowGear(instructor)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   193
			HogSay(instructor, loc(drill[3]), SAY_SHOUT)
3762
aef7d95dd159 Campaign:
smaxx
parents: 3761
diff changeset
   194
			TurnTimeLeft = 10000
3761
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   195
		end
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   196
	elseif progress == 2 then
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   197
		local x, y = GetGearPosition(player);
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   198
		if x > player_start_x then
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   199
			progress = 3
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   200
			FollowGear(instructor)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   201
			HogSay(instructor, loc(drill[4]), SAY_SAY)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   202
			time_start = GameTime
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   203
		end
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   204
	elseif progress == 3 and (time_start + 2500 == GameTime) then
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   205
		progress = 4
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   206
		FollowGear(instructor)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   207
		HogSay(instructor, loc(drill[5]), SAY_SHOUT)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   208
		HogTurnLeft(player, true)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   209
		TurnTimeLeft = 10000
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   210
	elseif progress == 4 then
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   211
		local x, y = GetGearPosition(player);
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   212
		if y < player_start_y then
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   213
			progress = 5
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   214
			FollowGear(instructor)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   215
			HogSay(instructor, "Yeah!", SAY_SAY)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   216
			time_start = GameTime
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   217
			TurnTimeLeft = 30000
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   218
		end
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   219
	elseif progress == 5 and (time_start + 2500 == GameTime) then
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   220
		FollowGear(instructor)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   221
		HogSay(instructor, loc(drill[6]), SAY_SAY)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   222
	elseif progress == 5 and (time_start + 5000 == GameTime) then
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   223
		FollowGear(instructor)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   224
		HogSay(instructor, loc(drill[7]), SAY_SAY)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   225
	elseif progress == 5 and (time_start + 7500 == GameTime) then
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   226
		FollowGear(instructor)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   227
		HogSay(instructor, loc(drill[8]), SAY_SHOUT)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   228
		ShowMission(loc(caption), loc(subcaption), loc(goals[1]), 1, 0);
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   229
		target = AddGear(target_x, target_y, gtTarget, 0, 0, 0, 0)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   230
		TurnTimeLeft = 60000
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   231
	elseif progress == 5 and (time_start + 10000 == GameTime) then
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   232
		FollowGear(target)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   233
	elseif progress == 6 then
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   234
		progress = 7
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   235
		ShowMission(loc(caption), loc(subcaption), loc(goals[2]), 0, 0);
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   236
		PlaySound(sndVictory);
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   237
		time_start = GameTime
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   238
	elseif progress == 7 and (time_start + 2500 == GameTime) then
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   239
		EndGame()
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   240
	end
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   241
end
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   242
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   243
function onGameInit()
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   244
	Seed = 0
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   245
	GameFlags = gfMultiWeapon + gfOneClanMode
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   246
	TurnTime = 25000
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   247
	CaseFreq = 0
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   248
	LandAdds = 0
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   249
	Explosives = 0
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   250
	Delay = 2500
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   251
	Map = "Mushrooms"
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   252
	Theme = "Nature"
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   253
	
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   254
	AddTeam(loc(teamnames[0]), teamcolor, "Simple", "Island", "Default")
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   255
	player = AddHog(loc(hognames[0]), 0, player_health, "NoHat")
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   256
	SetGearPosition(player, player_start_x, player_start_y);
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   257
	
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   258
	AddTeam(loc(teamnames[1]), teamcolor + 1, "Simple", "Island", "Default")
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   259
	instructor = AddHog(loc(hognames[1]), 0, instructor_health, "NoHat")
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   260
	SetGearPosition(instructor, player_start_x + 100, player_start_y)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   261
	HogTurnLeft(instructor, true)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   262
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   263
	FollowGear(player);
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   264
end
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   265
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   266
function onAmmoStoreInit()
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   267
	SetAmmo(amBazooka, 9, 0, 0, 0)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   268
end
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   269
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   270
function onGearDelete(gear)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   271
	if GetGearType(gear) == gtTarget then
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   272
		progress = 6
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   273
	end
4051
295cea095302 polish language patch
szczur
parents: 3762
diff changeset
   274
end