share/hedgewars/Data/Missions/Shotgun Training.hwt
changeset 2949 d137a9da7701
parent 2816 30fc14a79aa0
child 2950 81dd71096b1f
--- a/share/hedgewars/Data/Missions/Shotgun Training.hwt	Sat Mar 06 10:59:20 2010 +0000
+++ b/share/hedgewars/Data/Missions/Shotgun Training.hwt	Sat Mar 06 13:22:52 2010 +0000
@@ -8,6 +8,46 @@
 -- following "--" is ignored.
 
 ---------------------------------------------------------------
+-- At first we put all text we'd like to use in some arrays.
+-- This way we're able to localize the text to be shown without
+-- modifying other files.
+-- The language to be used is stored in the global variable
+-- 'L' that is set by the game (string).
+-- Text may then be accessed using "arrayname[L]".
+local caption = {
+	["en"] = "Bazooka Training",
+	["de"] = "Bazooka-Training"
+	}
+local subcaption = {
+	["en"] = "Aiming Practice",
+	["de"] = "Zielübung"
+	}
+
+local goal = {
+	["en"] = "Eliminate all targets before your time runs out.|You have unlimited ammo for this mission.",
+	["de"] = "Eliminiere alle Ziele bevor die Zeit ausläuft.|Du hast in dieser Mission unbegrenzte Munition."
+	}
+
+local timeout = {
+	["en"] = "Oh no! Time's up! Just try again.",
+	["de"] = "Oh nein! Die Zeit ist um! Versuche es nochmal."
+	}
+
+local success = {
+	["en"] = "Congratulations! You've eliminated all targets|within the allowed time frame.",
+	["de"] = "Gratulation! Du hast alle Ziele innerhalb der|verfügbaren Zeit ausgeschaltet."
+	}
+
+local teamname = {
+	["en"] = "Shotgun Team",
+	["de"] = "Die Knalltüten"
+	}
+
+local hogname = {
+	["en"] = "Hunter",
+	["de"] = "Jäger"
+	}
+---------------------------------------------------------------
 
 -- This variable will hold the number of destroyed targets.
 local score = 0
@@ -73,9 +113,9 @@
 	Theme = "nature"
 
 	-- Create the player team
-	AddTeam("Shotgun Team", 14483456, "Simple", "Island", "Default")
+	AddTeam(teamname[L], 14483456, "Simple", "Island", "Default")
 	-- And add a hog to it
-	player = AddHog("Hunter", 0, 1, "NoHat")
+	player = AddHog(hogname[L], 0, 1, "NoHat")
 	SetGearPosition(player, 2334, 1254);
 end
 
@@ -92,7 +132,7 @@
 	-- A negative icon parameter (-n) represents the n-th weapon icon
 	-- A positive icon paramter (n) represents the (n+1)-th mission icon
 	-- A timeframe of 0 is replaced with the default time to show.
-	ShowMission("Shotgun Training", "Aiming Practice", "Eliminate all targets before your time runs out.|You have unlimited ammo for this mission.", -5, 0);
+	ShowMission(caption[L], subcaption[L], goal[L], -amShotgun, 0);
 end
 
 -- This function is called every game tick.
@@ -106,7 +146,7 @@
 	if TurnTimeLeft == 1 and score < score_goal then
 		game_lost = true
 		-- ... and show a short message.
-		ShowMission("Shotgun Training", "Aiming Practice", "Oh no! Time's up! Just try again.", -amSkip, 0);
+		ShowMission(caption[L], subcaption[L], timeout[L], -amSkip, 0);
 		-- How about killing our poor hog due to his poor performance?
 		SetHealth(player, 0);
 		-- Just to be sure set the goal time to 1 ms
@@ -155,7 +195,7 @@
 		else
 			if not game_lost then
 			-- Otherwise show that the goal was accomplished
-			ShowMission("Shotgun Training", "Aiming Practice", "Congratulations! You've eliminated all targets|within the allowed time frame.", 0, 0);
+			ShowMission(caption[L], subcaption[L], success[L], 0, 0);
 			-- Also let the hogs shout "victory!"
 			PlaySound(sndVictory)
 			-- Save the time left so we may keep it.