share/hedgewars/Data/Missions/Campaign/01#Boot_Camp.lua
changeset 4594 5645462cc78f
child 4643 050af7a71cc1
equal deleted inserted replaced
4592:b1fe47b11b99 4594:5645462cc78f
       
     1 -- IMPORTANT -- THIS IS WORK IN PROGRESS AND VERY LIKELY TO BE CHANGED AGAIN
       
     2 -- IMPORTANT -- DO NOT TRANSLATE THIS AS IT USES THE OLD SYSTEM AND WILL BE UPDATED LATER!
       
     3 
       
     4 local teamnames = {}
       
     5 local hognames = {}
       
     6 teamnames[0] = {
       
     7 	["en"] = "Bloody Rookies",
       
     8 	["de"] = "Blutige Anfänger",
       
     9 	["pl"] = "Żótodzioby",
       
    10 	["sv"] = "Blodiga nybörjare",
       
    11 	["es"] = "Reclutas",
       
    12 	["pt_PT"] = "Recrutas",
       
    13 	["pt_BR"] = "Maldito Recrutas",
       
    14 	["sk"] = "Regruti"
       
    15 }
       
    16 
       
    17 teamnames[1] = {
       
    18 	["en"] = "Instructors",
       
    19 	["de"] = "Ausbilder",
       
    20 	["pl"] = "Instruktor",
       
    21 	["sv"] = "Instruktör",
       
    22 	["es"] = "Instructores",
       
    23 	["pt_PT"] = "Instrutores",
       
    24 	["pt_BR"] = "Instrutores",
       
    25 	["sk"] = "Inštruktori"
       
    26 }
       
    27 
       
    28 hognames[0] = {
       
    29 	["en"] = "Joker",
       
    30 	["de"] = "Joker",
       
    31 	["pl"] = "Joker",
       
    32 	["sv"] = "Joker",
       
    33 	["es"] = "Joker",
       
    34 	["pt_PT"] = "Joker",
       
    35 	["pt_BR"] = "Comediante",
       
    36 	["sk"] = "Komediant"
       
    37 }
       
    38 
       
    39 hognames[1] = {
       
    40 	["en"] = "Harthog",
       
    41 	["de"] = "Harthog",
       
    42 	["pl"] = "Harthog",
       
    43 	["sv"] = "Harthog",
       
    44 	["es"] = "Harthog",
       
    45 	["pt_PT"] = "Harthog",
       
    46 	["pt_BR"] = "Harthog",
       
    47 	["sk"] = "Harthog"
       
    48 }
       
    49 
       
    50 local caption = {
       
    51 	["en"] = "Boot Camp",
       
    52 	["de"] = "Grundausbildung",
       
    53 	["pl"] = "Poligon",
       
    54 	["sv"] = "Grundutbildning",
       
    55 	["es"] = "Campamento militar",
       
    56 	["pt_PT"] = "Acampamento militar",
       
    57 	["pt_BR"] = "Acampamento Militar",
       
    58 	["sk"] = "Výcvikový tábor"
       
    59 
       
    60 }
       
    61 
       
    62 local subcaption = {
       
    63 	["en"] = "Follow the instructions!",
       
    64 	["de"] = "Befolge die Anweisungen!",
       
    65 	["pl"] = "Wykonuj polecenia!",
       
    66 	["sv"] = "Följ instruktioner!",
       
    67 	["es"] = "¡Sigue las órdenes!",
       
    68 	["pt_PT"] = "Segue as instruções!",
       
    69 	["pt_BR"] = "Siga as ordens!",
       
    70 	["sk"] = "Postupujte podľa inštrukcií!"
       
    71 }
       
    72 
       
    73 local goals = {}
       
    74 
       
    75 goals[0] = {
       
    76 	["en"] = "Listen to your Drill Instructor and follow his lead!",
       
    77 	["de"] = "Höre deinem Ausbilder zu und befolge seine Anweisungen!",
       
    78 	["pl"] = "Słuchaj instruktora i wykonuj jego rozkazy!",
       
    79 	["sv"] = "Lyssna på din instruktör och gör som han säger!",
       
    80 	["es"] = "¡Escucha atentamente a tu instructor de maniobras y sigue sus órdenes!",
       
    81 	["pt_PT"] = "Ouve atentamente o teu Instrutor e segue as suas ordens!",
       
    82 	["pt_BR"] = "Escute seu instrutor de escavação e siga seu líder",
       
    83 	["sk"] = "Počúvajte vášho inštruktora výcviku a vykonávajte jeho rozkazy!"
       
    84 }
       
    85 
       
    86 goals[1] = {
       
    87 	["en"] = "Destroy the target to finish this mission!",
       
    88 	["de"] = "Zerstöre das Ziel, um diese Mission abzuschließen!",
       
    89 	["pl"] = "Zniszcz cel by ukończyć misję!",
       
    90 	["sv"] = "Förstör målet för att avklara uppdraget!",
       
    91 	["es"] = "¡Destruye el objetivo para completar esta misión!",
       
    92 	["pt_PT"] = "Destrói o alvo para completar esta missão!",
       
    93 	["pt_BR"] = "Destrua o alvo para concluir a missão",
       
    94 	["sk"] = "Pre ukončenie misie zneškodnite cieľ!"
       
    95 }
       
    96 
       
    97 goals[2] = {
       
    98 	["en"] = "Excellent! You've passed the Boot Camp!",
       
    99 	["de"] = "Ausgezeichnet! Du hast das Ausbildungslager bestanden!",
       
   100 	["pl"] = "Doskonale! Wyszedłeś cało z poligonu!",
       
   101 	["sv"] = "Brilliant! Du har klarat av grundutbildningen!",
       
   102 	["es"] = "¡Excelente! ¡Has completado la maniobra de hoy!",
       
   103 	["pt_PT"] = "Excelente! Completaste o treino para recrutas!",
       
   104 	["pt_BR"] = "Excelente! Você completou a manobra",
       
   105 	["pt_BR"] = "Výborne! Prešli ste výcvikovým táborom!"
       
   106 }
       
   107 
       
   108 local failed = {
       
   109 	["en"] = "You failed! Follow the instructions and shoot the target only!",
       
   110 	["de"] = "Du hast versagt! Befolge die Anweisungen und schieß nur auf das Ziel!",
       
   111 	["pl"] = "Przegrałeś! Wykonuj instrukcje poprawnie i strzelaj tylko w podane cele!",
       
   112 	["sv"] = "Du har misslyckats! Följ instruktionerna och sjut endast på målen!",
       
   113 	["es"] = "¡Has fallado! ¡Sigue las instrucciones y destruye únicamente el objetivo!",
       
   114 	["pt_PT"] = "Falhaste! Segue as instruções e destrói apenas o alvo!",
       
   115 	["pt_BR"] = "Você falhou! Siga as instruções e atire somente no alvo",
       
   116 	["sk"] = "Prehrali ste! Nasledujte inštrukcie a strieľajte iba na cieľ!"
       
   117 }
       
   118 
       
   119 local drill = {}
       
   120 
       
   121 drill[0] = {
       
   122 	["en"] = "Allright, maggot!",
       
   123 	["de"] = "Also gut, du Made!",
       
   124 	["pl"] = "Słuchaj mnie gnido!",
       
   125 	["sv"] = "Dåså, din mask!",
       
   126 	["es"] = "¡Muy bien, escoria!",
       
   127 	["pt_PT"] = "Bom trabalho verme!",
       
   128 	["pt_BR"] = "Parabéns escória",
       
   129 	["sk"] = "Počúvaj, ty červík!"
       
   130 }
       
   131 
       
   132 drill[1] = {
       
   133 	["en"] = "Show that you aren't that useless.",
       
   134 	["de"] = "Zeig, dass du nicht so nutzlos bist.",
       
   135 	["pl"] = "Udowodnij, że nie jesteś bezwartościowy.",
       
   136 	["sv"] = "Visa att du inte är så värdelös!",
       
   137 	["es"] = "Demuéstrame que no eres tan inútil como pareces.",
       
   138 	["pt_PT"] = "Prova-me que não és tão inútil como pareces.",
       
   139 	["pt_BR"] = "Mostre que você não é um inútil.",
       
   140 	["sk"] = "Dokáž, že nie si na svete úplne zbytočným."
       
   141 }
       
   142 
       
   143 drill[2] = {
       
   144 	["en"] = "Use [left] to move to the left!",
       
   145 	["de"] = "Benutze [Links], um nach links zu gehen!",
       
   146 	["pl"] = "Użyj [lewo] by poruszyć się w lewą stronę!",
       
   147 	["sv"] = "Använd [vänster] för att gå åt vänster!",
       
   148 	["es"] = "¡Aprieta [izquierda] para desplazarte a la izquierda!",
       
   149 	["pt_PT"] = "Carrega [esquerda] para te moveres para a esquerda!",
       
   150 	["pt_BR"] = "Use [esquerda] para mover para a esquerda",
       
   151 	["sk"] = "Stlačte [vľavo] pre pohyb doľava"
       
   152 }
       
   153 
       
   154 drill[3] = {
       
   155 	["en"] = "Good! Now use [right] to come back!",
       
   156 	["de"] = "Gut! Nun komm mit [Rechts] zurück!",
       
   157 	["pl"] = "Dobzre, Teraz użyj [prawo] by wrócić!",
       
   158 	["sv"] = "Bra! Använd nu [höger] för att gå tillbaka!",
       
   159 	["es"] = "¡Muy bien! ¡Ahora presiona [derecha] para volver!",
       
   160 	["pt_PT"] = "Muito bem! Agora pressiona [direita] para voltar!",
       
   161 	["pt_BR"] = "Bom! Agora use [direita] para voltar",
       
   162 	["sk"] = "Dobre! Teraz použite [vpravo] a vráťte sa naspäť!"
       
   163 }
       
   164 
       
   165 drill[4] = {
       
   166 	["en"] = "Excellent!",
       
   167 	["de"] = "Ausgezeichnet!",
       
   168 	["pl"] = "Wspaniale!",
       
   169 	["sv"] = "Utmärkt!",
       
   170 	["es"] = "¡Excelente!",
       
   171 	["pt_PT"] = "Excelente!",
       
   172 	["pt_BR"] = "Excelente!",
       
   173 	["sk"] = "Výborne!"
       
   174 }
       
   175 
       
   176 drill[5] = {
       
   177 	["en"] = "Now jump to the left using [return]!",
       
   178 	["de"] = "Jetzt springe mit [Eingabetaste] nach links!",
       
   179 	["pl"] = "Teraz skocz w lewo używając [Enter]",
       
   180 	["sv"] = "Hoppa nu åt vänster med hjälp av [enter]!",
       
   181 	["es"] = "¡Ahora salta hacia la izquierda usando [intro]!",
       
   182 	["pt_PT"] = "Agora salta para a esquerda pressionando [retrocesso]!",
       
   183 	["pt_BR"] = "Agora pule para a esquerda usando [return]!",
       
   184 	["sk"] = "Teraz skočte doľava stlačením [enter]!"
       
   185 }
       
   186 
       
   187 drill[6] = {
       
   188 	["en"] = "Use [up] and [down] to aim.",
       
   189 	["de"] = "Benutze [Hoch] und [Runter], um zu zielen.",
       
   190 	["pl"] = "Użyj klawiszy [góra] i [dół] by celować.",
       
   191 	["sv"] = "Använd [upp] och [ner] för att sikta!",
       
   192 	["es"] = "Presiora [arriba] y [abajo] para apuntar.",
       
   193 	["pt_PT"] = "Pressiona [cima] e [baixo] para apontar.",
       
   194 	["pt_BR"] = "Pressione [acima] e [abaixo] para mirar.",
       
   195 	["sk"] = "Stlačte [hore] a [dole] pre mierenie."
       
   196 }
       
   197 
       
   198 drill[7] = {
       
   199 	["en"] = "Hold [space] to power up your shot and then release it to shoot.",
       
   200 	["de"] = "Halte [Leertaste], um deinen Schuss aufzuladen, und lasse dann rechtzeitig los.",
       
   201 	["pl"] = "Przytrzymaj spację by zwiększyć siłę strzału.",
       
   202 	["sv"] = "Håll ner [mellanslag] för att få kraft och släpp för att skjuta!",
       
   203 	["es"] = "Mantén presionada la [barra espaciadora] para controlar la fuerza del disparo y suéltala para disparar.",
       
   204 	["pt_PT"] = "Mantem a [barra de espaços] pressionada para controlar a força do tiro e larga-a para disparar.",
       
   205 	["pt_BR"] = "Mantenha pressionado [espaço] para aumentar a força do seu tiro e solte para atirar",
       
   206 	["sk"] = "Držte stlačený [medzerník] pre nabíjanie, jeho uvoľnením vystrelíte."
       
   207 }
       
   208 
       
   209 drill[8] = {
       
   210 	["en"] = "Destroy the target to finish your basic training!",
       
   211 	["de"] = "Zerstöre das Ziel, um deine Grundausbildung abzuschließen!",
       
   212 	["pl"] = "Zniszcz cel by by ukończyć trening podstawowy!",
       
   213 	["sv"] = "Förstör målet för att avsluta din grundutbildning!",
       
   214 	["es"] = "¡Destruye el objetivo para completar el entrenamiento básico!",
       
   215 	["pt_PT"] = "Destrói o alvo para completar o treino básico!",
       
   216 	["pt_BR"] = "Destrua o alvo para terminar o treino básico",
       
   217 	["sk"] = "Zneškodnite cieľ na ukončenie základného výcviku!"
       
   218 }
       
   219 
       
   220 local function loc(text)
       
   221 	if text == nil then return "**missing**"
       
   222 	elseif text[L] == nil then return text["en"]
       
   223 	else return text[L]
       
   224 	end
       
   225 end
       
   226 
       
   227 local player = nil
       
   228 local instructor = nil
       
   229 local target = nil
       
   230 
       
   231 function onGameStart()
       
   232 
       
   233 end
       
   234 
       
   235 local player_start_x = 2300
       
   236 local player_start_y = 1250
       
   237 local target_x = 1900
       
   238 local target_y = 1250
       
   239 local player_health = 100
       
   240 local instructor_health = 100
       
   241 local teamcolor = 14483456
       
   242 
       
   243 local progress = 0
       
   244 local time_start = 0
       
   245 
       
   246 function onGameTick()
       
   247 	if progress == -1 and (time_start + 2500) == GameTime then
       
   248 		EndGame()
       
   249 	elseif progress == -1 then
       
   250 		
       
   251 	elseif progress > 0 and ((TurnTimeLeft == 0) or (GetHealth(player) ~= player_health) or (GetHealth(instructor) ~= instructor_health)) then
       
   252 		progress = -1
       
   253 		ShowMission(loc(caption), loc(subcaption), loc(failed), -amBazooka, 0)
       
   254 		time_start = GameTime
       
   255 		PlaySound(sndNooo)
       
   256 		TurnTimeLeft = 0
       
   257 	elseif GameTime == 0 then
       
   258 		ShowMission(loc(caption), loc(subcaption), loc(goals[0]), -amBazooka, 0)
       
   259 		TurnTimeLeft = 60000
       
   260 	elseif GameTime == 2500 then
       
   261 		FollowGear(instructor)
       
   262 		HogSay(instructor, loc(drill[0]), SAY_SAY)
       
   263 	elseif GameTime == 5000 then
       
   264 		FollowGear(instructor)
       
   265 		HogSay(instructor, loc(drill[1]), SAY_SAY)
       
   266 	elseif GameTime == 7500 then
       
   267 		FollowGear(instructor)
       
   268 		HogSay(instructor, loc(drill[2]), SAY_SHOUT)
       
   269 		progress = 1
       
   270 		TurnTimeLeft = 10000
       
   271 	elseif progress == 1 then
       
   272 		local x, y = GetGearPosition(player)
       
   273 		if x < player_start_x - 50 then
       
   274 			progress = 2
       
   275 			FollowGear(instructor)
       
   276 			HogSay(instructor, loc(drill[3]), SAY_SHOUT)
       
   277 			TurnTimeLeft = 10000
       
   278 		end
       
   279 	elseif progress == 2 then
       
   280 		local x, y = GetGearPosition(player)
       
   281 		if x > player_start_x then
       
   282 			progress = 3
       
   283 			FollowGear(instructor)
       
   284 			HogSay(instructor, loc(drill[4]), SAY_SAY)
       
   285 			time_start = GameTime
       
   286 		end
       
   287 	elseif progress == 3 and (time_start + 2500 == GameTime) then
       
   288 		progress = 4
       
   289 		FollowGear(instructor)
       
   290 		HogSay(instructor, loc(drill[5]), SAY_SHOUT)
       
   291 		HogTurnLeft(player, true)
       
   292 		TurnTimeLeft = 10000
       
   293 	elseif progress == 4 then
       
   294 		local x, y = GetGearPosition(player)
       
   295 		if y < player_start_y then
       
   296 			progress = 5
       
   297 			FollowGear(instructor)
       
   298 			HogSay(instructor, "Yeah!", SAY_SAY)
       
   299 			time_start = GameTime
       
   300 			TurnTimeLeft = 30000
       
   301 		end
       
   302 	elseif progress == 5 and (time_start + 2500 == GameTime) then
       
   303 		FollowGear(instructor)
       
   304 		HogSay(instructor, loc(drill[6]), SAY_SAY)
       
   305 	elseif progress == 5 and (time_start + 5000 == GameTime) then
       
   306 		FollowGear(instructor)
       
   307 		HogSay(instructor, loc(drill[7]), SAY_SAY)
       
   308 	elseif progress == 5 and (time_start + 7500 == GameTime) then
       
   309 		FollowGear(instructor)
       
   310 		HogSay(instructor, loc(drill[8]), SAY_SHOUT)
       
   311 		ShowMission(loc(caption), loc(subcaption), loc(goals[1]), 1, 0)
       
   312 		target = AddGear(target_x, target_y, gtTarget, 0, 0, 0, 0)
       
   313 		TurnTimeLeft = 60000
       
   314 	elseif progress == 5 and (time_start + 10000 == GameTime) then
       
   315 		FollowGear(target)
       
   316 	elseif progress == 6 then
       
   317 		progress = 7
       
   318 		ShowMission(loc(caption), loc(subcaption), loc(goals[2]), 0, 0)
       
   319 		PlaySound(sndVictory)
       
   320 		time_start = GameTime
       
   321 	elseif progress == 7 and (time_start + 2500 == GameTime) then
       
   322 		EndGame()
       
   323 	end
       
   324 end
       
   325 
       
   326 function onGameInit()
       
   327 	Seed = 0
       
   328 	GameFlags = gfMultiWeapon + gfOneClanMode
       
   329 	TurnTime = 25000
       
   330 	CaseFreq = 0
       
   331 	MinesNum = 0
       
   332 	Explosives = 0
       
   333 	Delay = 2500
       
   334 	Map = "Mushrooms"
       
   335 	Theme = "Nature"
       
   336 	
       
   337 	AddTeam(loc(teamnames[0]), teamcolor, "Simple", "Island", "Default")
       
   338 	player = AddHog(loc(hognames[0]), 0, player_health, "NoHat")
       
   339 	SetGearPosition(player, player_start_x, player_start_y)
       
   340 	
       
   341 	AddTeam(loc(teamnames[1]), teamcolor + 1, "Simple", "Island", "Default")
       
   342 	instructor = AddHog(loc(hognames[1]), 0, instructor_health, "NoHat")
       
   343 	SetGearPosition(instructor, player_start_x + 100, player_start_y)
       
   344 	HogTurnLeft(instructor, true)
       
   345 
       
   346 	FollowGear(player)
       
   347 end
       
   348 
       
   349 function onAmmoStoreInit()
       
   350 	SetAmmo(amBazooka, 9, 0, 0, 0)
       
   351 end
       
   352 
       
   353 function onGearDelete(gear)
       
   354 	if GetGearType(gear) == gtTarget then
       
   355 		progress = 6
       
   356 	end
       
   357 end