share/hedgewars/Data/Missions/Scenario/User_Mission_-_The_Great_Escape.lua
changeset 13060 aed0374bbd8a
parent 12933 e65aa3c3d4e6
child 14483 310b167141cc
equal deleted inserted replaced
13059:2f21d92eae27 13060:aed0374bbd8a
       
     1 HedgewarsScriptLoad("/Scripts/SimpleMission.lua")
     1 HedgewarsScriptLoad("/Scripts/Locale.lua")
     2 HedgewarsScriptLoad("/Scripts/Locale.lua")
       
     3 SimpleMission({
       
     4 	missionTitle = loc("The Great Escape"),
       
     5 	goalText = loc("Eliminate your captor.") .."|".. loc("Unlimited Attacks: Attacks don't end your turn"),
       
     6 	missionIcon = -amGrenade,
       
     7 	wind = 100,
       
     8 	initVars = {
       
     9 		TurnTime = 45000,
       
    10 		Map = "Castle",
       
    11 		Theme = "Nature",
       
    12 		MinesTime = 0,
       
    13 		Seed = 0,
       
    14 		GameFlags = gfInfAttack + gfDisableWind,
       
    15 	},
       
    16 	ammoConfig = {
       
    17 		[amGrenade] = { count = 1 },
       
    18 		[amParachute] = { count = 1 },
       
    19 		[amFirePunch] = { ammoInCrate = 3 },
       
    20 	},
       
    21 	teams = {
       
    22 		{ name = loc("Hero Team"),
       
    23 		flag = "cm_swordshield",
       
    24 		grave = "star",
       
    25 		hogs = {{ name = loc("Good Dude"), health = 1, x = 1050, y = 534 }},
       
    26 		},
       
    27 		{ name = loc("Bad Team"),
       
    28 		flag = "cm_dragonrb",
       
    29 		grave = "dragonball",
       
    30 		hogs = {{ name = loc("Bad Guy"), health = 1, x = 1512, y = 158, botLevel = 1 }}
       
    31 		},
       
    32 	},
       
    33 	girders = {
       
    34 		{ x = 1042, y = 564, frameIdx = 0 },
       
    35 		{ x = 1028, y = 474, frameIdx = 6 },
       
    36 		{ x = 1074, y = 474, frameIdx = 6 },
       
    37 		{ x = 1050, y = 385, frameIdx = 0 },
       
    38 		{ x = 1175, y = 731, frameIdx = 7 },
       
    39 		{ x = 1452, y = 905, frameIdx = 2 },
       
    40 		{ x = 1522, y = 855, frameIdx = 4 },
       
    41 		{ x = 1496, y = 900, frameIdx = 3 },
       
    42 		{ x = 1682, y = 855, frameIdx = 4 },
       
    43 		{ x = 1773, y = 887, frameIdx = 2 },
       
    44 		{ x = 1647, y = 901, frameIdx = 1 },
       
    45 		{ x = 1871, y = 883, frameIdx = 6 },
       
    46 		{ x = 1871, y = 723, frameIdx = 6 },
       
    47 		{ x = 1774, y = 768, frameIdx = 6 },
       
    48 		{ x = 1773, y = 767, frameIdx = 6 },
       
    49 		{ x = 1821, y = 904, frameIdx = 1 },
       
    50 		{ x = 1822, y = 802, frameIdx = 3 },
       
    51 		{ x = 1820, y = 723, frameIdx = 1 },
       
    52 		{ x = 1782, y = 678, frameIdx = 4 },
       
    53 		{ x = 1822, y = 661, frameIdx = 0 },
       
    54 		{ x = 1822, y = 644, frameIdx = 0 },
       
    55 		{ x = 1742, y = 644, frameIdx = 0 },
       
    56 		{ x = 1742, y = 661, frameIdx = 0 },
       
    57 		{ x = 1694, y = 676, frameIdx = 2 },
       
    58 		{ x = 1903, y = 635, frameIdx = 0 },
       
    59 	},
       
    60 	gears = {
       
    61 		{ type = gtMine, x = 1010, y = 680 },
       
    62 		{ type = gtMine, x = 1031, y = 720 },
       
    63 		{ type = gtMine, x = 1039, y = 748 },
       
    64 		{ type = gtMine, x = 1051, y = 777 },
       
    65 		{ type = gtMine, x = 1065, y = 796 },
     2 
    66 
     3 local player = nil
    67 		{ type = gtCase, crateType = "supply", x = 1632, y = 943, ammoType = amShotgun },
     4 local enemy = nil
    68 		{ type = gtCase, crateType = "supply", x = 1723, y = 888, ammoType = amFirePunch },
       
    69 		{ type = gtCase, crateType = "supply", x = 1915, y = 599, ammoType = amGrenade },
       
    70 		{ type = gtCase, crateType = "supply", x = 1416, y = 913, ammoType = amBlowTorch },
       
    71 		{ type = gtCase, crateType = "supply", x = 1227, y = 640, ammoType = amPickHammer },
       
    72 		{ type = gtCase, crateType = "supply", x = 1519, y = 945, ammoType = amParachute},
     5 
    73 
     6 function onGameInit()
    74 		{ type = gtCase, crateType = "health", x = 1476, y = 169 },
     7 
    75 		{ type = gtCase, crateType = "health", x = 1551, y = 177 },
     8 	Map = "Castle"
    76 		{ type = gtCase, crateType = "health", x = 1586, y = 200 },
     9 	Theme = "Nature"
    77 		{ type = gtCase, crateType = "health", x = 1439, y = 189 },
    10 	Seed = 0
    78 		{ type = gtCase, crateType = "health", x = 1401, y = 211 },
    11 	GameFlags = gfInfAttack
    79 		{ type = gtCase, crateType = "health", x = 1633, y = 210 },
    12 
    80 	},
    13 	TurnTime = 45 * 1000
    81 })
    14 
       
    15 	CaseFreq = 0
       
    16 	MinesNum = 0
       
    17 	Explosives = 0
       
    18 
       
    19 	AddTeam(loc("Hero Team"), 14483456, "star", "Island", "Default", "cm_swordshield")
       
    20 	player = AddHog(loc("Good Dude"), 0, 80, "NoHat") --NoHat
       
    21 
       
    22 	AddTeam(loc("Bad Team"), 	1175851, "dragonball", "Island", "Default", "cm_dragonrb")
       
    23 	enemy = AddHog(loc("Bad Guy"), 1, 40, "NoHat")
       
    24 
       
    25 end
       
    26 
       
    27 function onGameStart()
       
    28 
       
    29 ShowMission(loc("The Great Escape"), loc("Scenario"), loc("Elimate your captor.") .. "|" .. loc("Mines time: 0 seconds"), -amGrenade, 0)
       
    30 
       
    31 ------ GIRDER LIST ------
       
    32 PlaceGirder(1042,564,0)
       
    33 PlaceGirder(1028,474,6)
       
    34 PlaceGirder(1074,474,6)
       
    35 PlaceGirder(1050,385,0)
       
    36 PlaceGirder(1175,731,7)
       
    37 PlaceGirder(1452,905,2)
       
    38 PlaceGirder(1522,855,4)
       
    39 PlaceGirder(1496,900,3)
       
    40 PlaceGirder(1682,855,4)
       
    41 PlaceGirder(1773,887,2)
       
    42 PlaceGirder(1647,901,1)
       
    43 PlaceGirder(1871,883,6)
       
    44 PlaceGirder(1871,723,6)
       
    45 PlaceGirder(1774,768,6)
       
    46 PlaceGirder(1773,767,6)
       
    47 PlaceGirder(1821,904,1)
       
    48 PlaceGirder(1822,802,3)
       
    49 PlaceGirder(1820,723,1)
       
    50 PlaceGirder(1782,678,4)
       
    51 PlaceGirder(1822,661,0)
       
    52 PlaceGirder(1822,644,0)
       
    53 PlaceGirder(1742,644,0)
       
    54 PlaceGirder(1742,661,0)
       
    55 PlaceGirder(1694,676,2)
       
    56 PlaceGirder(1903,635,0)
       
    57 ------ HEALTH CRATE LIST ------
       
    58 SpawnHealthCrate(1476,169)
       
    59 SpawnHealthCrate(1551,177)
       
    60 SpawnHealthCrate(1586,200)
       
    61 SpawnHealthCrate(1439,189)
       
    62 SpawnHealthCrate(1401,211)
       
    63 SpawnHealthCrate(1633,210)
       
    64 ------ MINE LIST ------
       
    65 tempG = AddGear(1010,680,gtMine, 0, 0, 0, 0)
       
    66 SetTimer(tempG, 1)
       
    67 tempG = AddGear(1031,720,gtMine, 0, 0, 0, 0)
       
    68 SetTimer(tempG, 1)
       
    69 tempG = AddGear(1039,748,gtMine, 0, 0, 0, 0)
       
    70 SetTimer(tempG, 1)
       
    71 tempG = AddGear(1051,777,gtMine, 0, 0, 0, 0)
       
    72 SetTimer(tempG, 1)
       
    73 tempG = AddGear(1065,796,gtMine, 0, 0, 0, 0)
       
    74 SetTimer(tempG, 1)
       
    75 tempG = AddGear(1094,800,gtMine, 0, 0, 0, 0)
       
    76 SetTimer(tempG, 1)
       
    77 ------ REPOSITION LIST ------
       
    78 SetGearPosition(player,1050,534)
       
    79 SetGearPosition(enemy,1512,158)
       
    80 SetHealth(player, 1)
       
    81 SetHealth(enemy, 1)
       
    82 ------ CRATE LIST ------
       
    83 SpawnSupplyCrate(1632,943,amShotgun)
       
    84 SpawnSupplyCrate(1723,888,amFirePunch)
       
    85 SpawnSupplyCrate(1915,599,amGrenade)
       
    86 SpawnSupplyCrate(1416,913,amBlowTorch)
       
    87 SpawnSupplyCrate(1227,640,amPickHammer)
       
    88 SpawnSupplyCrate(1519,945,amParachute)
       
    89 ------ END LOADING DATA ------
       
    90 
       
    91 end
       
    92 
       
    93 function onGameTick()
       
    94 
       
    95 	if TurnTimeLeft == TurnTime-1 then
       
    96 		SetWind(100)
       
    97 	end
       
    98 
       
    99 end
       
   100 
       
   101 function onGearDelete(gear)
       
   102 	if (GetGearType(gear) == gtCase) and (CurrentHedgehog == player) then
       
   103 		if GetHealth(gear) > 0 then
       
   104 			AddGear(GetX(gear), GetY(gear), gtGrenade, 0, 0, 0, 1)
       
   105 		end
       
   106 	elseif gear == player then
       
   107 		ShowMission(loc("The Great Escape"), loc("MISSION FAILED"), loc("Oh no! Just try again!"), -amSkip, 0)
       
   108 	elseif gear == enemy then
       
   109 		ShowMission(loc("The Great Escape"), loc("MISSION SUCCESSFUL"), loc("Congratulations!"), 0, 0)
       
   110 	end
       
   111 end
       
   112 
       
   113 function onAmmoStoreInit()
       
   114 	SetAmmo(amGrenade, 1, 0, 0, 1)
       
   115 	SetAmmo(amParachute, 1, 0, 0, 1)
       
   116 	SetAmmo(amFirePunch, 0, 0, 0, 3)
       
   117 	SetAmmo(amPickHammer, 0, 0, 0, 1)
       
   118 	SetAmmo(amBlowTorch, 0, 0, 0, 1)
       
   119 	SetAmmo(amShotgun, 0, 0, 0, 1)
       
   120 	SetAmmo(amSkip, 9, 0, 0, 0)
       
   121 end