share/hedgewars/Data/Missions/Training/Basic_Training_-_Rope.lua
changeset 14935 632538406573
parent 14933 4c5fb1ee75b7
child 14946 c645327d0a81
equal deleted inserted replaced
14934:f112847eb93e 14935:632538406573
   279 
   279 
   280 function onGearDamage(gear)
   280 function onGearDamage(gear)
   281 	if gear == hog then
   281 	if gear == hog then
   282 		flawless = false
   282 		flawless = false
   283 	end
   283 	end
       
   284 end
       
   285 
       
   286 local function dropNadeText(time)
       
   287 	ShowMission(loc("Basic Rope Training"), loc("Rope Weapons"),
       
   288 	loc("Some weapons can be dropped from the rope.").."|"..
       
   289 	loc("Collect the weapon crate and drop|a grenade from rope to destroy the barrels.").."|"..
       
   290 	loc("Step 1: Start roping").."|"..
       
   291 	loc("Step 2: Select grenade").."|"..
       
   292 	loc("Step 3: Drop the grenade").."| |"..
       
   293 	loc("Drop weapon (while on rope): [Long Jump]"), 2, time)
   284 end
   294 end
   285 
   295 
   286 function onGearDelete(gear)
   296 function onGearDelete(gear)
   287 	if GetGearType(gear) == gtTarget then
   297 	if GetGearType(gear) == gtTarget then
   288 		-- Update checkpoint
   298 		-- Update checkpoint
   310 			loc("Well done! The next target awaits.").."|"..
   320 			loc("Well done! The next target awaits.").."|"..
   311 			loc("Hint: The rope only bends around objects.|When it doesn't hit anything, it's always straight."), 2, 7000)
   321 			loc("Hint: The rope only bends around objects.|When it doesn't hit anything, it's always straight."), 2, 7000)
   312 			eraseGirder(8)
   322 			eraseGirder(8)
   313 			eraseGirder(9)
   323 			eraseGirder(9)
   314 		elseif currentTarget == 5 then
   324 		elseif currentTarget == 5 then
   315 			ShowMission(loc("Basic Rope Training"), loc("Rope Weapons"),
   325 			dropNadeText(20000)
   316 			loc("Some weapons can be dropped from the rope.").."|"..
       
   317 			loc("Collect the weapon crate and drop|a grenade from rope to destroy the barrels.").."|"..
       
   318 			loc("Step 1: Start roping").."|"..
       
   319 			loc("Step 2: Select grenade").."|"..
       
   320 			loc("Step 3: Drop the grenade").."| |"..
       
   321 			loc("Drop weapon (while on rope): [Long Jump]"), 2, 20000)
       
   322 			AddAmmo(hog, amBaseballBat, 0)
   326 			AddAmmo(hog, amBaseballBat, 0)
   323 			SpawnAmmoCrate(1849, 920, amGrenade, AMMO_INFINITE)
   327 			SpawnAmmoCrate(1849, 920, amGrenade, AMMO_INFINITE)
   324 		elseif currentTarget == 6 then
   328 		elseif currentTarget == 6 then
   325 			ShowMission(loc("Basic Rope Training"), loc("Finite Ropes"),
   329 			ShowMission(loc("Basic Rope Training"), loc("Finite Ropes"),
   326 			loc("So far, you had infinite ropes, but in the|real world, ropes are usually limited.").."|"..
   330 			loc("So far, you had infinite ropes, but in the|real world, ropes are usually limited.").."|"..
   403 end
   407 end
   404 
   408 
   405 function onAttack()
   409 function onAttack()
   406 	if GetCurAmmoType() == amGrenade and not ropeGear then
   410 	if GetCurAmmoType() == amGrenade and not ropeGear then
   407 		AddCaption(loc("You have to drop the grenade from rope!"), 0xFF4000FF, capgrpMessage)
   411 		AddCaption(loc("You have to drop the grenade from rope!"), 0xFF4000FF, capgrpMessage)
       
   412 		dropNadeText(5000)
   408 		PlaySound(sndDenied)
   413 		PlaySound(sndDenied)
   409 	end
   414 	end
   410 end
   415 end