share/hedgewars/Data/Missions/Scenario/User_Mission_-_Newton_and_the_Hammock.lua
changeset 13057 8b44518d1002
parent 12933 e65aa3c3d4e6
child 14504 310b167141cc
equal deleted inserted replaced
13056:b1a230d21a48 13057:8b44518d1002
     1 
     1 HedgewarsScriptLoad("/Scripts/SimpleMission.lua")
     2 HedgewarsScriptLoad("/Scripts/Locale.lua")
     2 HedgewarsScriptLoad("/Scripts/Locale.lua")
     3 
     3 
     4 local player = nil 
     4 SimpleMission({
     5 local enemy = nil
     5 	missionTitle = loc("Newton and the Hammock"),
     6 local failed = false
     6 	missionIcon = -amJetpack,
       
     7 	initVars = {
       
     8 		TurnTime = 60000,
       
     9 		MinesTime = 1000,
       
    10 		Map = "Hammock",
       
    11 		Theme = "Nature",
       
    12 		MapGen = mgRandom,
       
    13 		MapFeatureSize = 12,
       
    14 	},
       
    15 	teams = {
       
    16 		{ name = loc("Pathetic Resistance"),
       
    17 		clanID = 0,
       
    18 		flag = "cm_yinyang",
       
    19 		grave = "Plinko",
       
    20 		hogs = {
       
    21 			{name = loc("Ikeda"), health = 48, x = 397, y = 865, hat = "StrawHat"}
       
    22 		}, },
     7 
    23 
     8 local hhs = {}
    24 		{ name = loc("Cybernetic Empire"),
     9 local numhhs = 0
    25 		clanID = 5,
    10 
    26 		flag = "cm_cyborg",
    11 function onGameInit()
    27 		grave = "ring",
    12 
    28 		voice = "Robot",
    13 	Seed = 0
    29 		hogs = {
    14 	TurnTime = 60000 
    30 			{name=loc("Unit 881"), x=561, y=1365, health=100, hat="cyborg1", botLevel=1,
    15 	CaseFreq = 0
    31 			ammo = {
    16 	MinesTime  = 1000
    32 				[amShotgun] = 100,
    17 	-- Disable Sudden Death
    33 				[amFirePunch] = 100,
    18 	HealthDecrease = 0
    34 			},},
    19 	WaterRise = 0
    35 		},
    20 	HealthCaseProb = 35
    36 		}
    21 	Explosives = 0
    37 	},
    22 	MinesNum = 0
    38 	girders = {
    23 	Map = "Hammock" 
    39 		{ x=1073, y=2009, frameIdx=0, },
    24 	Theme = "Nature"
    40 		{ x=524, y=1487, frameIdx=3, },
    25 
    41 		{ x=638, y=1453, frameIdx=4, },
    26 	AddTeam(loc("Pathetic Resistance"), 14483456, "Statue", "Island", "Default", "cm_duckhead")
    42 		{ x=761, y=1453, frameIdx=0, },
    27 	player = AddHog(loc("Ikeda"), 0, 48, "StrawHat")
    43 		{ x=840, y=1421, frameIdx=3, },
    28 			
    44 		{ x=302, y=1388, frameIdx=6, },
    29 	AddTeam(loc("Cybernetic Empire"), 	1175851, "ring", "Island", "Robot", "cm_cyborg")
    45 		{ x=327, y=1506, frameIdx=1, },
    30 	enemy = AddHog(loc("Unit") .. " 811", 1, 100, "cyborg1")
    46 		{ x=1669, y=1832, frameIdx=3, },
    31 
    47 	},
    32 	SetGearPosition(player,430,1540)
    48 	gears = {
    33 	SetGearPosition(enemy,1464,1960)
    49 		{ type = gtMine, x = 1056, y = 1987 },
    34 
    50 		{ type = gtMine, x = 1086, y = 1988 },
    35 end
    51 		{ type = gtSMine, x = 1089, y =965 },
    36 
    52 		{ type = gtSMine, x = 1133, y =945 },
    37 
    53 		{ type = gtSMine, x = 1010, y =1081 },
    38 function onGameStart()
    54 		{ type = gtSMine, x = 1036, y =1049 },
    39 
    55 		{ type = gtSMine, x = 1057, y =1004 },
    40 	AddAmmo(enemy, amShotgun, 100)
    56 		{ type = gtSMine, x = 784, y =1252 },
    41 	AddAmmo(enemy, amFirePunch, 100)
    57 		{ type = gtSMine, x = 841, y =1257 },
    42 
    58 		{ type = gtSMine, x = 902, y =1263 },
    43 	--GIRDER LIST. 
    59 		{ type = gtSMine, x = 952, y =1281 },
    44 	PlaceGirder(1073,2009,0)
    60 		{ type = gtSMine, x = 517, y =1546 },
    45 	PlaceGirder(524,1487,3)
    61 		{ type = gtSMine, x = 559, y =1597 },
    46 	PlaceGirder(638,1453,4)
    62 		{ type = gtSMine, x = 613, y =1650 },
    47 	PlaceGirder(761,1453,0)
    63 		{ type = gtSMine, x = 674, y =1705 },
    48 	PlaceGirder(840,1421,3)
    64 		{ type = gtSMine, x = 746, y =1692 },
    49 	PlaceGirder(302,1388,6)
    65 		{ type = gtSMine, x = 810, y =1692 },
    50 	PlaceGirder(327,1506,1)
    66 		{ type = gtSMine, x = 872, y =1673 },
    51 	PlaceGirder(1669,1832,3)
    67 		{ type = gtSMine, x = 933, y =1666 },
    52 	--MINE LIST. 
    68 		{ type = gtSMine, x = 981, y =1662 },
    53 	AddGear(1056,1987,gtMine, 0, 0, 0, 0)
    69 		{ type = gtSMine, x = 1016, y =1634 },
    54 	AddGear(1086,1988,gtMine, 0, 0, 0, 0)
    70 		{ type = gtSMine, x = 1063, y =1595 },
    55 	--STICKY MINE LIST. 
    71 		{ type = gtSMine, x = 1100, y =1574 },
    56 	AddGear(1089,965,gtSMine, 0, 0, 0, 0)
    72 		{ type = gtSMine, x = 1002, y =1461 },
    57 	AddGear(1133,945,gtSMine, 0, 0, 0, 0)	
    73 		{ type = gtSMine, x = 1052, y =1438 },
    58 	AddGear(1010,1081,gtSMine, 0, 0, 0, 0)
    74 		{ type = gtSMine, x = 1102, y =1464 },
    59 	AddGear(1036,1049,gtSMine, 0, 0, 0, 0)
    75 		{ type = gtCase, x = 1565, y = 642, crateType="supply", ammoType = amSineGun },
    60 	AddGear(1057,1004,gtSMine, 0, 0, 0, 0)
    76 		{ type = gtCase, x = 548, y = 858, crateType="supply", ammoType = amBazooka },
    61 	AddGear(784,1252,gtSMine, 0, 0, 0, 0)
    77 		{ type = gtCase, x = 479, y = 847, crateType="supply", ammoType = amJetpack },
    62 	AddGear(841,1257,gtSMine, 0, 0, 0, 0)
    78 		{ type = gtCase, x = 1550, y = 1715, crateType="supply", ammoType = amBlowTorch },
    63 	AddGear(902,1263,gtSMine, 0, 0, 0, 0)
    79 		{ type = gtCase, x = 1227, y = 1941, crateType="supply", ammoType = amJetpack },
    64 	AddGear(952,1281,gtSMine, 0, 0, 0, 0)
    80 		{ type = gtCase, x = 1070, y = 1964, crateType="supply", ammoType = amInvulnerable },
    65 	AddGear(517,1546,gtSMine, 0, 0, 0, 0)
    81 		{ type = gtCase, x = 1070, y = 1875, crateType="supply", ammoType = amTeleport },
    66 	AddGear(559,1597,gtSMine, 0, 0, 0, 0)
    82 	},
    67 	AddGear(613,1650,gtSMine, 0, 0, 0, 0)
    83 })
    68 	AddGear(674,1705,gtSMine, 0, 0, 0, 0)
       
    69 	AddGear(746,1692,gtSMine, 0, 0, 0, 0)
       
    70 	AddGear(810,1692,gtSMine, 0, 0, 0, 0)
       
    71 	AddGear(872,1673,gtSMine, 0, 0, 0, 0)
       
    72 	AddGear(933,1666,gtSMine, 0, 0, 0, 0)
       
    73 	AddGear(981,1662,gtSMine, 0, 0, 0, 0)
       
    74 	AddGear(1016,1634,gtSMine, 0, 0, 0, 0)
       
    75 	AddGear(1063,1595,gtSMine, 0, 0, 0, 0)
       
    76 	AddGear(1100,1574,gtSMine, 0, 0, 0, 0)
       
    77 	AddGear(1002,1461,gtSMine, 0, 0, 0, 0)
       
    78 	AddGear(1052,1438,gtSMine, 0, 0, 0, 0)
       
    79 	AddGear(1102,1464,gtSMine, 0, 0, 0, 0)
       
    80 	-- CRATE LIST.
       
    81 	SpawnSupplyCrate(1565,642,amSineGun)
       
    82 	SpawnSupplyCrate(548,858,amBazooka)
       
    83 
       
    84 	SpawnSupplyCrate(479,847,amJetpack)
       
    85 	SpawnSupplyCrate(1550,1715,amBlowTorch)
       
    86 	SpawnSupplyCrate(1227,1941,amJetpack)
       
    87 	SpawnSupplyCrate(1070,1964,amInvulnerable)
       
    88 	SpawnSupplyCrate(1070,1875,amTeleport)
       
    89 	--HOG POSITION LIST.
       
    90 	if hhs[0] ~= nil then
       
    91        		 SetGearPosition(hhs[0],397,865)
       
    92 	end
       
    93 		if hhs[1] ~= nil then
       
    94         	SetGearPosition(hhs[1],561,1365)
       
    95 	end
       
    96 
       
    97 	ShowMission(loc("Newton and the Hammock"), loc("Scenario"), loc("Eliminate the enemy.") .. "|" .. loc("Mines time: 1 second"), -amParachute, 0)
       
    98 		
       
    99 end
       
   100 
       
   101 function onAmmoStoreInit()
       
   102 	SetAmmo(amSkip, 9, 0, 0, 1)
       
   103 	SetAmmo(amBazooka, 0, 0, 0, 1)
       
   104 	SetAmmo(amJetpack, 0, 0, 0, 1)
       
   105 	SetAmmo(amTeleport, 0, 0, 0, 1)
       
   106 	SetAmmo(amSineGun, 0, 0, 0, 1)
       
   107 	SetAmmo(amInvulnerable, 0, 0, 0, 1)
       
   108 	SetAmmo(amBlowTorch, 0, 0, 0, 1)
       
   109 end
       
   110 
       
   111 function onGearDamage(gear, damage)
       
   112 	if (gear == player) and (damage >= 48) then
       
   113 		failed = true
       
   114 	end
       
   115 end
       
   116 
       
   117 function onGearAdd(gear)
       
   118 
       
   119 	if GetGearType(gear) == gtHedgehog then
       
   120 		hhs[numhhs] = gear
       
   121 		numhhs = numhhs + 1
       
   122 	end	
       
   123 
       
   124 end
       
   125 
       
   126 function onGearDelete(gear)
       
   127 
       
   128 	if (gear == enemy) and (failed == false) then
       
   129 		ShowMission(loc("Newton and the Hammock"), loc("MISSION SUCCESSFUL"), loc("Congratulations!"), 0, 0)
       
   130 	elseif gear == player then
       
   131 		ShowMission(loc("Newton and the Hammock"), loc("MISSION FAILED"), loc("Oh no! Just try again!"), -amSkip, 0)
       
   132 	end
       
   133 
       
   134 end