share/hedgewars/Data/Missions/Campaign/01#Boot Camp.lua
author Henek
Sun, 07 Nov 2010 17:30:20 +0300
changeset 4162 923db448ad16
parent 4080 5809a2360d45
child 4170 7fb7386423d8
permissions -rw-r--r--
update and fix some lua stuff
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3761
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
     1
-- IMPORTANT -- THIS IS WORK IN PROGRESS AND VERY LIKELY TO BE CHANGED AGAIN
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
     2
-- IMPORTANT -- SAVE YOURSELF THE WORK AND DON'T TRANSLATE THE TEXTS IF YOU FEAR STARTING OVER LATER!
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
     3
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
     4
local teamnames = {}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
     5
local hognames = {}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
     6
teamnames[0] = {
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
     7
	["en"] = "Bloody Rookies",
4070
adeaefdcbd64 polish update, fix encoding
szczur
parents: 4051
diff changeset
     8
	["de"] = "Blutige Anfänger",
4073
582350d49e98 again w/ the swedish
henek
parents: 4071
diff changeset
     9
	["pl"] = "Żótodzioby",
4080
5809a2360d45 Updated mission translations
Palewolf
parents: 4073
diff changeset
    10
	["sv"] = "Blodiga nybörjare",
5809a2360d45 Updated mission translations
Palewolf
parents: 4073
diff changeset
    11
	["es"] = "Reclutas"
3761
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    12
}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    13
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    14
teamnames[1] = {
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    15
	["en"] = "Instructors",
4051
295cea095302 polish language patch
szczur
parents: 3762
diff changeset
    16
	["de"] = "Ausbilder",
4073
582350d49e98 again w/ the swedish
henek
parents: 4071
diff changeset
    17
	["pl"] = "Instruktor",
4080
5809a2360d45 Updated mission translations
Palewolf
parents: 4073
diff changeset
    18
	["sv"] = "Instruktör",
5809a2360d45 Updated mission translations
Palewolf
parents: 4073
diff changeset
    19
	["es"] = "Instructores"
3761
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    20
}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    21
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    22
hognames[0] = {
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    23
	["en"] = "Joker",
4051
295cea095302 polish language patch
szczur
parents: 3762
diff changeset
    24
	["de"] = "Joker",
4073
582350d49e98 again w/ the swedish
henek
parents: 4071
diff changeset
    25
	["pl"] = "Joker",
4080
5809a2360d45 Updated mission translations
Palewolf
parents: 4073
diff changeset
    26
	["sv"] = "Joker",
5809a2360d45 Updated mission translations
Palewolf
parents: 4073
diff changeset
    27
	["es"] = "Joker"
3761
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    28
}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    29
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    30
hognames[1] = {
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    31
	["en"] = "Harthog",
4051
295cea095302 polish language patch
szczur
parents: 3762
diff changeset
    32
	["de"] = "Harthog",
4073
582350d49e98 again w/ the swedish
henek
parents: 4071
diff changeset
    33
	["pl"] = "Harthog",
4080
5809a2360d45 Updated mission translations
Palewolf
parents: 4073
diff changeset
    34
	["sv"] = "Harthog",
5809a2360d45 Updated mission translations
Palewolf
parents: 4073
diff changeset
    35
	["es"] = "Harthog"
3761
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    36
}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    37
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    38
local caption = {
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    39
	["en"] = "Boot Camp",
4051
295cea095302 polish language patch
szczur
parents: 3762
diff changeset
    40
	["de"] = "Grundausbildung",
4073
582350d49e98 again w/ the swedish
henek
parents: 4071
diff changeset
    41
	["pl"] = "Poligon",
4080
5809a2360d45 Updated mission translations
Palewolf
parents: 4073
diff changeset
    42
	["sv"] = "Grundutbildning",
5809a2360d45 Updated mission translations
Palewolf
parents: 4073
diff changeset
    43
	["es"] = "Campamento militar"
3761
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    44
}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    45
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    46
local subcaption = {
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    47
	["en"] = "Follow the instructions!",
4051
295cea095302 polish language patch
szczur
parents: 3762
diff changeset
    48
	["de"] = "Befolge die Anweisungen!",
4073
582350d49e98 again w/ the swedish
henek
parents: 4071
diff changeset
    49
	["pl"] = "Wykonuj polecenia!",
4080
5809a2360d45 Updated mission translations
Palewolf
parents: 4073
diff changeset
    50
	["sv"] = "Följ instruktioner!",
5809a2360d45 Updated mission translations
Palewolf
parents: 4073
diff changeset
    51
	["es"] = "¡Sigue las órdenes!"
3761
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    52
}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    53
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    54
local goals = {}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    55
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    56
goals[0] = {
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    57
	["en"] = "Listen to your Drill Instructor and follow his lead!",
4070
adeaefdcbd64 polish update, fix encoding
szczur
parents: 4051
diff changeset
    58
	["de"] = "Höre deinem Ausbilder zu und befolge seine Anweisungen!",
4073
582350d49e98 again w/ the swedish
henek
parents: 4071
diff changeset
    59
	["pl"] = "Słuchaj instruktora i wykonuj jego rozkazy!",
4080
5809a2360d45 Updated mission translations
Palewolf
parents: 4073
diff changeset
    60
	["sv"] = "Lyssna på din instruktör och gör som han säger!",
5809a2360d45 Updated mission translations
Palewolf
parents: 4073
diff changeset
    61
	["es"] = "¡Escucha atentamente a tu instructor de maniobras y sigue sus órdenes!"
3761
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    62
}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    63
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    64
goals[1] = {
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    65
	["en"] = "Destroy the target to finish this mission!",
4070
adeaefdcbd64 polish update, fix encoding
szczur
parents: 4051
diff changeset
    66
	["de"] = "Zerstöre das Ziel, um diese Mission abzuschließen!",
4073
582350d49e98 again w/ the swedish
henek
parents: 4071
diff changeset
    67
	["pl"] = "Zniszcz cel by ukończyć misję!",
4080
5809a2360d45 Updated mission translations
Palewolf
parents: 4073
diff changeset
    68
	["sv"] = "Förstör målet för att avklara uppdraget!",
5809a2360d45 Updated mission translations
Palewolf
parents: 4073
diff changeset
    69
	["es"] = "¡Destruye el objetivo para completar esta misión!"
3761
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    70
}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    71
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    72
goals[2] = {
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    73
	["en"] = "Excellent! You've passed the Boot Camp!",
4051
295cea095302 polish language patch
szczur
parents: 3762
diff changeset
    74
	["de"] = "Ausgezeichnet! Du hast das Ausbildungslager bestanden!",
4073
582350d49e98 again w/ the swedish
henek
parents: 4071
diff changeset
    75
	["pl"] = "Doskonale! Wyszedłeś cało z poligonu!",
4080
5809a2360d45 Updated mission translations
Palewolf
parents: 4073
diff changeset
    76
	["sv"] = "Brilliant! Du har klarat av grundutbildningen!",
5809a2360d45 Updated mission translations
Palewolf
parents: 4073
diff changeset
    77
	["es"] = "¡Excelente! ¡Has completado la maniobra de hoy!"
3761
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    78
}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    79
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    80
local failed = {
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    81
	["en"] = "You failed! Follow the instructions and shoot the target only!",
4070
adeaefdcbd64 polish update, fix encoding
szczur
parents: 4051
diff changeset
    82
	["de"] = "Du hast versagt! Befolge die Anweisungen und schieß nur auf das Ziel!",
4073
582350d49e98 again w/ the swedish
henek
parents: 4071
diff changeset
    83
	["pl"] = "Przegrałeś! Wykonuj instrukcje poprawnie i strzelaj tylko w podane cele!",
4080
5809a2360d45 Updated mission translations
Palewolf
parents: 4073
diff changeset
    84
	["sv"] = "Du har misslyckats! Följ instruktionerna och sjut endast på målen!",
5809a2360d45 Updated mission translations
Palewolf
parents: 4073
diff changeset
    85
	["es"] = "¡Has fallado! ¡Sigue las instrucciones y destruye únicamente el objetivo!"
3761
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    86
}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    87
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    88
local drill = {}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    89
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    90
drill[0] = {
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    91
	["en"] = "Allright, maggot!",
4051
295cea095302 polish language patch
szczur
parents: 3762
diff changeset
    92
	["de"] = "Also gut, du Made!",
4073
582350d49e98 again w/ the swedish
henek
parents: 4071
diff changeset
    93
	["pl"] = "Słuchaj mnie gnido!",
4080
5809a2360d45 Updated mission translations
Palewolf
parents: 4073
diff changeset
    94
	["sv"] = "Dåså, din mask!",
5809a2360d45 Updated mission translations
Palewolf
parents: 4073
diff changeset
    95
	["es"] = "¡Muy bien, escoria!"
3761
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    96
}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    97
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    98
drill[1] = {
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
    99
	["en"] = "Show that you aren't that useless.",
4051
295cea095302 polish language patch
szczur
parents: 3762
diff changeset
   100
	["de"] = "Zeig, dass du nicht so nutzlos bist.",
4073
582350d49e98 again w/ the swedish
henek
parents: 4071
diff changeset
   101
	["pl"] = "Udowodnij, że nie jesteś bezwartościowy.",
4080
5809a2360d45 Updated mission translations
Palewolf
parents: 4073
diff changeset
   102
	["sv"] = "Visa att du inte är så värdelös!",
5809a2360d45 Updated mission translations
Palewolf
parents: 4073
diff changeset
   103
	["es"] = "Demuéstrame que no eres tan inútil como pareces."
3761
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   104
}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   105
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   106
drill[2] = {
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   107
	["en"] = "Use [left] to move to the left!",
4051
295cea095302 polish language patch
szczur
parents: 3762
diff changeset
   108
	["de"] = "Benutze [Links], um nach links zu gehen!",
4073
582350d49e98 again w/ the swedish
henek
parents: 4071
diff changeset
   109
	["pl"] = "Użyj [lewo] by poruszyć się w lewą stronę!",
4080
5809a2360d45 Updated mission translations
Palewolf
parents: 4073
diff changeset
   110
	["sv"] = "Använd [vänster] för att gå åt vänster!",
5809a2360d45 Updated mission translations
Palewolf
parents: 4073
diff changeset
   111
	["es"] = "¡Aprieta [izquierda] para desplazarte a la izquierda!"
3761
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   112
}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   113
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   114
drill[3] = {
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   115
	["en"] = "Good! Now use [right] to come back!",
4070
adeaefdcbd64 polish update, fix encoding
szczur
parents: 4051
diff changeset
   116
	["de"] = "Gut! Nun komm mit [Rechts] zurück!",
4073
582350d49e98 again w/ the swedish
henek
parents: 4071
diff changeset
   117
	["pl"] = "Dobzre, Teraz użyj [prawo] by wrócić!",
4080
5809a2360d45 Updated mission translations
Palewolf
parents: 4073
diff changeset
   118
	["sv"] = "Bra! Använd nu [höger] för att gå tillbaka!",
5809a2360d45 Updated mission translations
Palewolf
parents: 4073
diff changeset
   119
	["es"] = "¡Muy bien! ¡Ahora presiona [derecha] para volver!"
3761
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   120
}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   121
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   122
drill[4] = {
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   123
	["en"] = "Excellent!",
4051
295cea095302 polish language patch
szczur
parents: 3762
diff changeset
   124
	["de"] = "Ausgezeichnet!",
4073
582350d49e98 again w/ the swedish
henek
parents: 4071
diff changeset
   125
	["pl"] = "Wspaniale!",
4080
5809a2360d45 Updated mission translations
Palewolf
parents: 4073
diff changeset
   126
	["sv"] = "Utmärkt!",
5809a2360d45 Updated mission translations
Palewolf
parents: 4073
diff changeset
   127
	["es"] = "¡Excelente!"
3761
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   128
}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   129
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   130
drill[5] = {
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   131
	["en"] = "Now jump to the left using [return]!",
4051
295cea095302 polish language patch
szczur
parents: 3762
diff changeset
   132
	["de"] = "Jetzt springe mit [Eingabetaste] nach links!",
4073
582350d49e98 again w/ the swedish
henek
parents: 4071
diff changeset
   133
	["pl"] = "Teraz skocz w lewo używając [Enter]",
4080
5809a2360d45 Updated mission translations
Palewolf
parents: 4073
diff changeset
   134
	["sv"] = "Hoppa nu åt vänster med hjälp av [enter]!",
5809a2360d45 Updated mission translations
Palewolf
parents: 4073
diff changeset
   135
	["es"] = "¡Ahora salta hacia la izquierda usando [intro]!"
3761
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   136
}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   137
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   138
drill[6] = {
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   139
	["en"] = "Use [up] and [down] to aim.",
4051
295cea095302 polish language patch
szczur
parents: 3762
diff changeset
   140
	["de"] = "Benutze [Hoch] und [Runter], um zu zielen.",
4073
582350d49e98 again w/ the swedish
henek
parents: 4071
diff changeset
   141
	["pl"] = "Użyj klawiszy [góra] i [dół] by celować.",
4080
5809a2360d45 Updated mission translations
Palewolf
parents: 4073
diff changeset
   142
	["sv"] = "Använd [upp] och [ner] för att sikta!",
5809a2360d45 Updated mission translations
Palewolf
parents: 4073
diff changeset
   143
	["es"] = "Presiora [arriba] y [abajo] para apuntar."
3761
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   144
}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   145
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   146
drill[7] = {
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   147
	["en"] = "Hold [space] to power up your shot and then release it to shoot.",
4051
295cea095302 polish language patch
szczur
parents: 3762
diff changeset
   148
	["de"] = "Halte [Leertaste], um deinen Schuss aufzuladen, und lasse dann rechtzeitig los.",
4073
582350d49e98 again w/ the swedish
henek
parents: 4071
diff changeset
   149
	["pl"] = "Przytrzymaj spację by zwiększyć siłę strzału.",
4080
5809a2360d45 Updated mission translations
Palewolf
parents: 4073
diff changeset
   150
	["sv"] = "Håll ner [mellanslag] för att få kraft och släpp för att skjuta!",
5809a2360d45 Updated mission translations
Palewolf
parents: 4073
diff changeset
   151
	["es"] = "Mantén presionada la [barra espaciadora] para controlar la fuerza del disparo y suéltala para disparar."
3761
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   152
}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   153
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   154
drill[8] = {
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   155
	["en"] = "Destroy the target to finish your basic training!",
4070
adeaefdcbd64 polish update, fix encoding
szczur
parents: 4051
diff changeset
   156
	["de"] = "Zerstöre das Ziel, um deine Grundausbildung abzuschließen!",
4073
582350d49e98 again w/ the swedish
henek
parents: 4071
diff changeset
   157
	["pl"] = "Zniszcz cel by by ukończyć trening podstawowy!",
4080
5809a2360d45 Updated mission translations
Palewolf
parents: 4073
diff changeset
   158
	["sv"] = "Förstör målet för att avsluta din grundutbildning!",
5809a2360d45 Updated mission translations
Palewolf
parents: 4073
diff changeset
   159
	["es"] = "¡Destruye el objetivo para completar el entrenamiento básico!"
3761
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   160
}
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   161
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   162
local function loc(text)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   163
	if text == nil then return "**missing**"
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   164
	elseif text[L] == nil then return text["en"]
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   165
	else return text[L]
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   166
	end
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   167
end
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   168
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   169
local player = nil
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   170
local instructor = nil
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   171
local target = nil
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   172
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   173
function onGameStart()
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   174
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   175
end
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   176
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   177
local player_start_x = 2300
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   178
local player_start_y = 1250
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   179
local target_x = 1900
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   180
local target_y = 1250
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   181
local player_health = 100
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   182
local instructor_health = 100
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   183
local teamcolor = 14483456
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   184
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   185
local progress = 0
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   186
local time_start = 0
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   187
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   188
function onGameTick()
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   189
	if progress == -1 and (time_start + 2500) == GameTime then
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   190
		EndGame()
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   191
	elseif progress == -1 then
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   192
		
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   193
	elseif progress > 0 and ((TurnTimeLeft == 0) or (GetHealth(player) ~= player_health) or (GetHealth(instructor) ~= instructor_health)) then
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   194
		progress = -1
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   195
		ShowMission(loc(caption), loc(subcaption), loc(failed), -amBazooka, 0);
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   196
		time_start = GameTime
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   197
		PlaySound(sndNooo)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   198
		TurnTimeLeft = 0
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   199
	elseif GameTime == 0 then
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   200
		ShowMission(loc(caption), loc(subcaption), loc(goals[0]), -amBazooka, 0);
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   201
		TurnTimeLeft = 60000
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   202
	elseif GameTime == 2500 then
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   203
		FollowGear(instructor)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   204
		HogSay(instructor, loc(drill[0]), SAY_SAY)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   205
	elseif GameTime == 5000 then
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   206
		FollowGear(instructor)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   207
		HogSay(instructor, loc(drill[1]), SAY_SAY)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   208
	elseif GameTime == 7500 then
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   209
		FollowGear(instructor)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   210
		HogSay(instructor, loc(drill[2]), SAY_SHOUT)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   211
		progress = 1
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   212
		TurnTimeLeft = 10000
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   213
	elseif progress == 1 then
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   214
		local x, y = GetGearPosition(player);
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   215
		if x < player_start_x - 50 then
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   216
			progress = 2
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   217
			FollowGear(instructor)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   218
			HogSay(instructor, loc(drill[3]), SAY_SHOUT)
3762
aef7d95dd159 Campaign:
smaxx
parents: 3761
diff changeset
   219
			TurnTimeLeft = 10000
3761
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   220
		end
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   221
	elseif progress == 2 then
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   222
		local x, y = GetGearPosition(player);
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   223
		if x > player_start_x then
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   224
			progress = 3
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   225
			FollowGear(instructor)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   226
			HogSay(instructor, loc(drill[4]), SAY_SAY)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   227
			time_start = GameTime
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   228
		end
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   229
	elseif progress == 3 and (time_start + 2500 == GameTime) then
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   230
		progress = 4
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   231
		FollowGear(instructor)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   232
		HogSay(instructor, loc(drill[5]), SAY_SHOUT)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   233
		HogTurnLeft(player, true)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   234
		TurnTimeLeft = 10000
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   235
	elseif progress == 4 then
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   236
		local x, y = GetGearPosition(player);
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   237
		if y < player_start_y then
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   238
			progress = 5
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   239
			FollowGear(instructor)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   240
			HogSay(instructor, "Yeah!", SAY_SAY)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   241
			time_start = GameTime
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   242
			TurnTimeLeft = 30000
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   243
		end
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   244
	elseif progress == 5 and (time_start + 2500 == GameTime) then
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   245
		FollowGear(instructor)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   246
		HogSay(instructor, loc(drill[6]), SAY_SAY)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   247
	elseif progress == 5 and (time_start + 5000 == GameTime) then
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   248
		FollowGear(instructor)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   249
		HogSay(instructor, loc(drill[7]), SAY_SAY)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   250
	elseif progress == 5 and (time_start + 7500 == GameTime) then
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   251
		FollowGear(instructor)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   252
		HogSay(instructor, loc(drill[8]), SAY_SHOUT)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   253
		ShowMission(loc(caption), loc(subcaption), loc(goals[1]), 1, 0);
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   254
		target = AddGear(target_x, target_y, gtTarget, 0, 0, 0, 0)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   255
		TurnTimeLeft = 60000
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   256
	elseif progress == 5 and (time_start + 10000 == GameTime) then
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   257
		FollowGear(target)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   258
	elseif progress == 6 then
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   259
		progress = 7
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   260
		ShowMission(loc(caption), loc(subcaption), loc(goals[2]), 0, 0);
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   261
		PlaySound(sndVictory);
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   262
		time_start = GameTime
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   263
	elseif progress == 7 and (time_start + 2500 == GameTime) then
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   264
		EndGame()
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   265
	end
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   266
end
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   267
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   268
function onGameInit()
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   269
	Seed = 0
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   270
	GameFlags = gfMultiWeapon + gfOneClanMode
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   271
	TurnTime = 25000
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   272
	CaseFreq = 0
4162
923db448ad16 update and fix some lua stuff
Henek
parents: 4080
diff changeset
   273
	MinesNum = 0
3761
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   274
	Explosives = 0
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   275
	Delay = 2500
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   276
	Map = "Mushrooms"
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   277
	Theme = "Nature"
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   278
	
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   279
	AddTeam(loc(teamnames[0]), teamcolor, "Simple", "Island", "Default")
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   280
	player = AddHog(loc(hognames[0]), 0, player_health, "NoHat")
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   281
	SetGearPosition(player, player_start_x, player_start_y);
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   282
	
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   283
	AddTeam(loc(teamnames[1]), teamcolor + 1, "Simple", "Island", "Default")
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   284
	instructor = AddHog(loc(hognames[1]), 0, instructor_health, "NoHat")
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   285
	SetGearPosition(instructor, player_start_x + 100, player_start_y)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   286
	HogTurnLeft(instructor, true)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   287
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   288
	FollowGear(player);
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   289
end
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   290
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   291
function onAmmoStoreInit()
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   292
	SetAmmo(amBazooka, 9, 0, 0, 0)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   293
end
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   294
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   295
function onGearDelete(gear)
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   296
	if GetGearType(gear) == gtTarget then
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   297
		progress = 6
f96b99f944e6 Engine:
smaxx
parents:
diff changeset
   298
	end
4051
295cea095302 polish language patch
szczur
parents: 3762
diff changeset
   299
end