share/hedgewars/Data/Missions/Training/Basic_Training_-_Grenade.lua
changeset 14403 f9d4b8222903
parent 13752 110d6c1e817f
child 14409 cf49fac6e88a
equal deleted inserted replaced
14402:32e8c81ca35c 14403:f9d4b8222903
    94 		AddGear(15, 240, gtTarget, 0, 0, 0, 0)
    94 		AddGear(15, 240, gtTarget, 0, 0, 0, 0)
    95 		AddGear(61, 9, gtTarget, 0, 0, 0, 0)
    95 		AddGear(61, 9, gtTarget, 0, 0, 0, 0)
    96 		AddGear(945, 498, gtTarget, 0, 0, 0, 0)
    96 		AddGear(945, 498, gtTarget, 0, 0, 0, 0)
    97 	-- Bounciness
    97 	-- Bounciness
    98 	elseif gamePhase == 4 then
    98 	elseif gamePhase == 4 then
    99 		AddGear(323, 960, gtTarget, 0, 0, 0, 0)
       
   100 		AddGear(1318, 208, gtTarget, 0, 0, 0, 0)
    99 		AddGear(1318, 208, gtTarget, 0, 0, 0, 0)
   101 		AddGear(1697, 250, gtTarget, 0, 0, 0, 0)
   100 		AddGear(1697, 250, gtTarget, 0, 0, 0, 0)
   102 		AddGear(1852, 100, gtTarget, 0, 0, 0, 0)
   101 		if INTERFACE ~= "touch" then
       
   102 			-- These targets may be too hard in touch interface because you cannot set bounciness yet
       
   103 			-- FIXME: Allow these targets in touch when bounciness can be set
       
   104 			AddGear(323, 960, gtTarget, 0, 0, 0, 0)
       
   105 			AddGear(1852, 100, gtTarget, 0, 0, 0, 0)
       
   106 		end
   103 	-- Grand Final
   107 	-- Grand Final
   104 	elseif gamePhase == 5 then
   108 	elseif gamePhase == 5 then
   105 		AddGear(186, 473, gtTarget, 0, 0, 0, 0)
   109 		AddGear(186, 473, gtTarget, 0, 0, 0, 0)
   106 		AddGear(950, 250, gtTarget, 0, 0, 0, 0)
   110 		AddGear(950, 250, gtTarget, 0, 0, 0, 0)
   107 		AddGear(1102, 345, gtTarget, 0, 0, 0, 0)
   111 		AddGear(1102, 345, gtTarget, 0, 0, 0, 0)
   115 	ShowMission(loc("Basic Grenade Training"), loc("Basic Training"), loc("Destroy all the targets!"), -amGrenade, 0)
   119 	ShowMission(loc("Basic Grenade Training"), loc("Basic Training"), loc("Destroy all the targets!"), -amGrenade, 0)
   116 end
   120 end
   117 
   121 
   118 function newGamePhase()
   122 function newGamePhase()
   119 	-- Spawn targets, update wind and ammo, show instructions
   123 	-- Spawn targets, update wind and ammo, show instructions
       
   124 	local ctrl = ""
   120 	if gamePhase == 0 then
   125 	if gamePhase == 0 then
       
   126 		if INTERFACE == "desktop" then
       
   127 			ctrl = loc("Open ammo menu: [Right click]").."|"..
       
   128 			loc("Select weapon: [Left click]")
       
   129 		else
       
   130 			ctrl = loc("Open ammo menu: Tap the [suitcase]")
       
   131 		end
   121 		ShowMission(loc("Basic Grenade Training"), loc("Select Weapon"), loc("To begin with the training, select the grenade from the ammo menu!").."|"..
   132 		ShowMission(loc("Basic Grenade Training"), loc("Select Weapon"), loc("To begin with the training, select the grenade from the ammo menu!").."|"..
   122 		loc("Open ammo menu: [Right click]").."|"..
   133 		ctrl, 2, 5000)
   123 		loc("Select weapon: [Left click]"), 2, 5000)
       
   124 	elseif gamePhase == 1 then
   134 	elseif gamePhase == 1 then
       
   135 		if INTERFACE == "desktop" then
       
   136 			ctrl = loc("Attack: [Space]").."|"..
       
   137 			loc("Aim: [Up]/[Down]").."|"..
       
   138 			loc("Change direction: [Left]/[Right]")
       
   139 		elseif INTERFACE == "touch" then
       
   140 			ctrl = loc("Attack: Tap the [bomb]").."|"..
       
   141 			loc("Aim: [Up]/[Down]").."|"..
       
   142 			loc("Change direction: [Left]/[Right]")
       
   143 		end
   125 		ShowMission(loc("Basic Grenade Training"), loc("Warming Up"),
   144 		ShowMission(loc("Basic Grenade Training"), loc("Warming Up"),
   126 		loc("Throw a grenade to destroy the target!").."|"..
   145 		loc("Throw a grenade to destroy the target!").."|"..
   127 		loc("Hold the Attack key pressed for more power.").."|"..
   146 		loc("Hold the Attack key pressed for more power.").."|"..
   128 		loc("Attack: [Space]").."|"..
   147 		ctrl.."|"..
   129 		loc("Aim: [Up]/[Down]").."|"..
       
   130 		loc("Change direction: [Left]/[Right]").."|"..
       
   131 		loc("Note: Walking is disabled in this mission."), 2, 20000)
   148 		loc("Note: Walking is disabled in this mission."), 2, 20000)
   132 		spawnTargets()
   149 		spawnTargets()
   133 	elseif gamePhase == 2 then
   150 	elseif gamePhase == 2 then
       
   151 		if INTERFACE == "desktop" then
       
   152 			ctrl = loc("Set detonation timer: [1]-[5]")
       
   153 		elseif INTERFACE == "touch" then
       
   154 			ctrl = loc("Change detonation timer: Tap the [clock]")
       
   155 		end
   134 		ShowMission(loc("Basic Grenade Training"), loc("Timer"),
   156 		ShowMission(loc("Basic Grenade Training"), loc("Timer"),
   135 		loc("You can change the detonation timer of grenades.").."|"..
   157 		loc("You can change the detonation timer of grenades.").."|"..
   136 		loc("Grenades explode after 1 to 5 seconds (you decide).").."|"..
   158 		loc("Grenades explode after 1 to 5 seconds (you decide).").."|"..
   137 		loc("Set detonation timer: [1]-[5]"), 2, 15000)
   159 		ctrl, 2, 15000)
   138 		spawnTargets()
   160 		spawnTargets()
   139 	elseif gamePhase == 3 then
   161 	elseif gamePhase == 3 then
   140 		ShowMission(loc("Basic Grenade Training"), loc("No Wind Influence"), loc("Unlike bazookas, grenades are not influenced by wind.").."|"..
   162 		ShowMission(loc("Basic Grenade Training"), loc("No Wind Influence"), loc("Unlike bazookas, grenades are not influenced by wind.").."|"..
   141 		loc("Destroy the targets!"), 2, 6000)
   163 		loc("Destroy the targets!"), 2, 6000)
   142 		SetWind(50)
   164 		SetWind(50)
   143 		spawnTargets()
   165 		spawnTargets()
   144 	elseif gamePhase == 4 then
   166 	elseif gamePhase == 4 then
   145 		ShowMission(loc("Basic Grenade Training"), loc("Bounciness"),
   167 		local caption = loc("Bounciness")
   146 		loc("You can set the bounciness of grenades (and grenade-like weapons).").."|"..
   168 		if INTERFACE == "desktop" then
   147 		loc("Grenades with high bounciness bounce a lot and behave chaotic.").."|"..
   169 			ctrl = loc("You can set the bounciness of grenades (and grenade-like weapons).").."|"..
   148 		loc("With low bounciness, it barely bounces at all, but it is much more predictable.").."|"..
   170 			loc("Grenades with high bounciness bounce a lot and behave chaotic.").."|"..
   149 		loc("Try out different bounciness levels to reach difficult targets.").."|"..
   171 			loc("With low bounciness, it barely bounces at all, but it is much more predictable.").."|"..
   150 		loc("Set bounciness: [Left Shift] + [1]-[5]"),
   172 			loc("Try out different bounciness levels to reach difficult targets.").."|"..
   151 		2, 20000)
   173 			loc("Set bounciness: [Left Shift] + [1]-[5]")
       
   174 		elseif INTERFACE == "touch" then
       
   175 			-- FIXME: Bounciness can't be set in touch yet. :(
       
   176 			caption = loc("Well done!")
       
   177 			ctrl = loc("You're getting pretty good! Here are more targets for you.")
       
   178 		end
       
   179 
       
   180 		ShowMission(loc("Basic Grenade Training"), caption, ctrl, 2, 20000)
   152 		spawnTargets()
   181 		spawnTargets()
   153 	elseif gamePhase == 5 then
   182 	elseif gamePhase == 5 then
       
   183 		if INTERFACE == "desktop" then
       
   184 			ctrl = loc("Precise Aim: [Left Shift] + [Up]/[Down]")
       
   185 			-- FIXME: No precise aim in touch interface yet :(
       
   186 		end
   154 		ShowMission(loc("Basic Grenade Training"), loc("Final Targets"), loc("Good job! Now destroy the final targets to finish the training.").."|"..
   187 		ShowMission(loc("Basic Grenade Training"), loc("Final Targets"), loc("Good job! Now destroy the final targets to finish the training.").."|"..
   155 		loc("Precise Aim: [Left Shift] + [Up]/[Down]"),
   188 		ctrl,
   156 		2, 7000)
   189 		2, 7000)
   157 		spawnTargets()
   190 		spawnTargets()
   158 	elseif gamePhase == 6 then
   191 	elseif gamePhase == 6 then
   159 		ShowMission(loc("Basic Grenade Training"), loc("Training complete!"), loc("Congratulations!"), 0, 0)
   192 		ShowMission(loc("Basic Grenade Training"), loc("Training complete!"), loc("Congratulations!"), 0, 0)
   160 		SetInputMask(0)
   193 		SetInputMask(0)