share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/moon02.lua
changeset 12575 0c5ce463949b
parent 12538 952afc3d2df2
child 12577 e2b5c6e805e8
equal deleted inserted replaced
12574:2a7cc304c8be 12575:0c5ce463949b
    19 -- dialogs
    19 -- dialogs
    20 local dialog01 = {}
    20 local dialog01 = {}
    21 local dialog02 = {}
    21 local dialog02 = {}
    22 -- mission objectives
    22 -- mission objectives
    23 local goals = {
    23 local goals = {
    24 	[dialog01] = {missionName, loc("Challenge objectives"), challengeObjectives, 1, 4500},
    24 	[dialog01] = {missionName, loc("Challenge objectives"), challengeObjectives, 1, 0},
    25 }
    25 }
    26 -- hogs
    26 -- hogs
    27 local hero = {
    27 local hero = {
    28 	name = loc("Hog Solo"),
    28 	name = loc("Hog Solo"),
    29 	x = 1300,
    29 	x = 1300,
    54 	GameFlags = gfDisableWind
    54 	GameFlags = gfDisableWind
    55 	Seed = 1
    55 	Seed = 1
    56 	TurnTime = 25000
    56 	TurnTime = 25000
    57 	CaseFreq = 0
    57 	CaseFreq = 0
    58 	MinesNum = 0
    58 	MinesNum = 0
    59 	MinesTime = 1
       
    60 	Explosives = 0
    59 	Explosives = 0
    61 	Map = "moon02_map"
    60 	Map = "moon02_map"
    62 	Theme = "Cheese"
    61 	Theme = "Cheese"
    63 	-- Disable Sudden Death
    62 	-- Disable Sudden Death
    64 	WaterRise = 0
    63 	WaterRise = 0
    81 end
    80 end
    82 
    81 
    83 function onGameStart()
    82 function onGameStart()
    84 	AnimWait(hero.gear, 3000)
    83 	AnimWait(hero.gear, 3000)
    85 	FollowGear(hero.gear)
    84 	FollowGear(hero.gear)
    86 	ShowMission(missionName, loc("Challenge objectives"), challengeObjectives, -amSkip, 0)
       
    87 
    85 
    88 	AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0)
    86 	AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0)
    89 
    87 
    90 	AddAmmo(hero.gear, amRope, 1)
    88 	AddAmmo(hero.gear, amRope, 1)
    91 
    89 
    92 	SendHealthStatsOff()
    90 	SendHealthStatsOff()
    93 	hogTurn = runner.gear
    91 	hogTurn = runner.gear
    94 	AddAnim(dialog01)
    92 	AddAnim(dialog01)
       
    93 end
       
    94 
       
    95 function onGearAdd(gear)
       
    96 	if GetGearType(gear) == gtRope then
       
    97 		HideMission()
       
    98 	end
    95 end
    99 end
    96 
   100 
    97 function onNewTurn()
   101 function onNewTurn()
    98 	if startChallenge and currentPosition < 5 then
   102 	if startChallenge and currentPosition < 5 then
    99 		if CurrentHedgehog ~= hero.gear then
   103 		if CurrentHedgehog ~= hero.gear then
   148 -------------- ANIMATIONS ------------------
   152 -------------- ANIMATIONS ------------------
   149 
   153 
   150 function Skipanim(anim)
   154 function Skipanim(anim)
   151 	if goals[anim] ~= nil then
   155 	if goals[anim] ~= nil then
   152 		ShowMission(unpack(goals[anim]))
   156 		ShowMission(unpack(goals[anim]))
   153     end
   157 	end
   154     if anim == dialog01 then
   158     	if anim == dialog01 then
   155 		moveRunner()
   159 		moveRunner()
   156 	elseif anim == dialog02 then
   160 	elseif anim == dialog02 then
   157 		win()
   161 		win()
   158     end
   162 	end
   159 end
   163 end
   160 
   164 
   161 function AnimationSetup()
   165 function AnimationSetup()
   162 	-- DIALOG 01 - Start, game instructions
   166 	-- DIALOG 01 - Start, game instructions
   163 	AddSkipFunction(dialog01, Skipanim, {dialog01})
   167 	AddSkipFunction(dialog01, Skipanim, {dialog01})
   165 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("On the other side of the moon ..."), 5000}})
   169 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("On the other side of the moon ..."), 5000}})
   166 	table.insert(dialog01, {func = AnimSay, args = {runner.gear, loc("So you are interested in Professor Hogevil, huh?"), SAY_SAY, 3000}})
   170 	table.insert(dialog01, {func = AnimSay, args = {runner.gear, loc("So you are interested in Professor Hogevil, huh?"), SAY_SAY, 3000}})
   167 	table.insert(dialog01, {func = AnimSay, args = {runner.gear, loc("We'll play a game first."), SAY_SAY, 3000}})
   171 	table.insert(dialog01, {func = AnimSay, args = {runner.gear, loc("We'll play a game first."), SAY_SAY, 3000}})
   168 	table.insert(dialog01, {func = AnimSay, args = {runner.gear, loc("I'll let you know whatever I know about him if you manage to catch me 3 times."), SAY_SAY, 4000}})
   172 	table.insert(dialog01, {func = AnimSay, args = {runner.gear, loc("I'll let you know whatever I know about him if you manage to catch me 3 times."), SAY_SAY, 4000}})
   169 	table.insert(dialog01, {func = AnimSay, args = {runner.gear, loc("Let's go!"), SAY_SAY, 2000}})
   173 	table.insert(dialog01, {func = AnimSay, args = {runner.gear, loc("Let's go!"), SAY_SAY, 2000}})
       
   174 	table.insert(dialog01, {func = ShowMission, args = goals[dialog01]})
   170 	table.insert(dialog01, {func = moveRunner, args = {}})
   175 	table.insert(dialog01, {func = moveRunner, args = {}})
   171 	-- DIALOG 02 - Hog Solo story
   176 	-- DIALOG 02 - Hog Solo story
   172 	AddSkipFunction(dialog02, Skipanim, {dialog02})
   177 	AddSkipFunction(dialog02, Skipanim, {dialog02})
   173 	table.insert(dialog02, {func = AnimWait, args = {hero.gear, 3200}})
   178 	table.insert(dialog02, {func = AnimWait, args = {hero.gear, 3200}})
   174 	table.insert(dialog02, {func = AnimCaption, args = {hero.gear, loc("The truth about Professor Hogevil"), 5000}})
   179 	table.insert(dialog02, {func = AnimCaption, args = {hero.gear, loc("The truth about Professor Hogevil"), 5000}})