share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/fruit01.lua
branchspacecampaign
changeset 9508 c23bff98e3d2
parent 9506 adc05ca2cb10
child 9510 e7481fac10c4
equal deleted inserted replaced
9506:adc05ca2cb10 9508:c23bff98e3d2
    27 }
    27 }
    28 -- crates
    28 -- crates
    29 local crateWMX = 2170
    29 local crateWMX = 2170
    30 local crateWMY = 1950
    30 local crateWMY = 1950
    31 local health1X = 2680
    31 local health1X = 2680
    32 local health1Y = 716
    32 local health1Y = 916
    33 -- hogs
    33 -- hogs
    34 local hero = {}
    34 local hero = {}
    35 local yellow1 = {}
    35 local yellow1 = {}
    36 local green1 = {}
    36 local green1 = {}
    37 local green2 = {}
    37 local green2 = {}
    73 }
    73 }
    74 teamA.name = loc("Hog Solo")
    74 teamA.name = loc("Hog Solo")
    75 teamA.color = tonumber("38D61C",16) -- green  
    75 teamA.color = tonumber("38D61C",16) -- green  
    76 teamB.name = loc("Green Bananas")
    76 teamB.name = loc("Green Bananas")
    77 teamB.color = tonumber("38D61C",16) -- green
    77 teamB.color = tonumber("38D61C",16) -- green
    78 teamC.name = loc("Yellow Watermellons")
    78 teamC.name = loc("Yellow Watermelons")
    79 teamC.color = tonumber("DDFF00",16) -- yellow
    79 teamC.color = tonumber("DDFF00",16) -- yellow
    80 
    80 
    81 function onGameInit()
    81 function onGameInit()
    82 	Seed = 1
    82 	Seed = 1
    83 	TurnTime = 20000
    83 	TurnTime = 20000
   107 	AnimSetGearPosition(green3.gear, green3.x, green3.y)
   107 	AnimSetGearPosition(green3.gear, green3.x, green3.y)
   108 	HogTurnLeft(green3.gear, true)
   108 	HogTurnLeft(green3.gear, true)
   109 	green4.gear = AddHog(green4.name, 0, 100, "war_desertgrenadier1")
   109 	green4.gear = AddHog(green4.name, 0, 100, "war_desertgrenadier1")
   110 	AnimSetGearPosition(green4.gear, green4.x, green4.y)
   110 	AnimSetGearPosition(green4.gear, green4.x, green4.y)
   111 	HogTurnLeft(green4.gear, true)
   111 	HogTurnLeft(green4.gear, true)
   112 	-- Yellow Watermellons
   112 	-- Yellow Watermelons
   113 	AddTeam(teamC.name, teamC.color, "Bone", "Island", "HillBilly", "cm_birdy")
   113 	AddTeam(teamC.name, teamC.color, "Bone", "Island", "HillBilly", "cm_birdy")
   114 	yellow1.gear = AddHog(yellow1.name, 1, 100, "war_desertgrenadier1")
   114 	yellow1.gear = AddHog(yellow1.name, 1, 100, "war_desertgrenadier1")
   115 	AnimSetGearPosition(yellow1.gear, yellow1.x, yellow1.y)
   115 	AnimSetGearPosition(yellow1.gear, yellow1.x, yellow1.y)
   116 	-- the rest of the Yellow Watermellons
   116 	-- the rest of the Yellow Watermelons
   117 	for i=1,7 do
   117 	for i=1,7 do
   118 		yellowArmy[i].gear = AddHog(yellowArmy[i].name, 1, 100, "war_desertgrenadier1")
   118 		yellowArmy[i].gear = AddHog(yellowArmy[i].name, 1, 100, "war_desertgrenadier1")
   119 		AnimSetGearPosition(yellowArmy[i].gear, yellowArmy[i].x, yellowArmy[i].y)
   119 		AnimSetGearPosition(yellowArmy[i].gear, yellowArmy[i].x, yellowArmy[i].y)
   120 	end
   120 	end
   121 
   121 
   159 	AddAmmo(yellow1.gear, amSwitch, 100)
   159 	AddAmmo(yellow1.gear, amSwitch, 100)
   160 	for i=3,7 do
   160 	for i=3,7 do
   161 		HideHog(yellowArmy[i].gear)
   161 		HideHog(yellowArmy[i].gear)
   162 	end
   162 	end
   163 	
   163 	
       
   164 	-- crates
       
   165 	SpawnHealthCrate(health1X, health1Y)
       
   166 	SpawnAmmoCrate(crateWMX, crateWMY, amWatermelon)
       
   167 	
   164 	AddAnim(dialog01)
   168 	AddAnim(dialog01)
   165 	SendHealthStatsOff()
   169 	SendHealthStatsOff()
   166 end
   170 end
   167 
   171 
   168 function onNewTurn()
   172 function onNewTurn()
   188 	if gear == hero.gear then
   192 	if gear == hero.gear then
   189 		hero.dead = true
   193 		hero.dead = true
   190 	elseif gear == green1.gear then
   194 	elseif gear == green1.gear then
   191 		green1.dead = true
   195 		green1.dead = true
   192 	end
   196 	end
       
   197 end
       
   198 
       
   199 function onAmmoStoreInit()
       
   200 	SetAmmo(amWatermelon, 0, 0, 0, 1)
   193 end
   201 end
   194 
   202 
   195 function onPrecise()
   203 function onPrecise()
   196 	if GameTime > 3000 then
   204 	if GameTime > 3000 then
   197 		SetAnimSkip(true)   
   205 		SetAnimSkip(true)   
   326 	table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("So, I kindly ask for your help."), SAY_SAY, 3000}})
   334 	table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("So, I kindly ask for your help."), SAY_SAY, 3000}})
   327 	table.insert(dialog01, {func = AnimWait, args = {green1.gear, 2000}})
   335 	table.insert(dialog01, {func = AnimWait, args = {green1.gear, 2000}})
   328 	table.insert(dialog01, {func = AnimSay, args = {green1.gear, loc("You couldn't have come to a worse time Hog Solo!"), SAY_SAY, 3000}})
   336 	table.insert(dialog01, {func = AnimSay, args = {green1.gear, loc("You couldn't have come to a worse time Hog Solo!"), SAY_SAY, 3000}})
   329 	table.insert(dialog01, {func = AnimSay, args = {green1.gear, loc("The clan of the Red Strawberry wants to take over the dominion and overthrone king Pineapple."), SAY_SAY, 5000}})
   337 	table.insert(dialog01, {func = AnimSay, args = {green1.gear, loc("The clan of the Red Strawberry wants to take over the dominion and overthrone king Pineapple."), SAY_SAY, 5000}})
   330 	table.insert(dialog01, {func = AnimSay, args = {green1.gear, loc("Under normal circumstances we could easily defeat them but we have kindly sent most of our men to the kingdom of sand to help to the annual dusting of the king's palace."), SAY_SAY, 8000}})
   338 	table.insert(dialog01, {func = AnimSay, args = {green1.gear, loc("Under normal circumstances we could easily defeat them but we have kindly sent most of our men to the kingdom of sand to help to the annual dusting of the king's palace."), SAY_SAY, 8000}})
   331 	table.insert(dialog01, {func = AnimSay, args = {green1.gear, loc("However the army of Yellow Watermellons is about to attack any moment now."), SAY_SAY, 4000}})
   339 	table.insert(dialog01, {func = AnimSay, args = {green1.gear, loc("However the army of Yellow Watermelons is about to attack any moment now."), SAY_SAY, 4000}})
   332 	table.insert(dialog01, {func = AnimSay, args = {green1.gear, loc("I would gladly help you if we won this battle but under these circumstances I'll only help you if you fight for our side."), SAY_SAY, 6000}})
   340 	table.insert(dialog01, {func = AnimSay, args = {green1.gear, loc("I would gladly help you if we won this battle but under these circumstances I'll only help you if you fight for our side."), SAY_SAY, 6000}})
   333 	table.insert(dialog01, {func = AnimSay, args = {green1.gear, loc("What do you say? Will you fight for us?"), SAY_SAY, 3000}})
   341 	table.insert(dialog01, {func = AnimSay, args = {green1.gear, loc("What do you say? Will you fight for us?"), SAY_SAY, 3000}})
   334 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 500}})
   342 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 500}})
   335 	table.insert(dialog01, {func = ShowMission, args = {missionName, loc("Ready for Battle?"), loc("Walk left if you want to join Captain Lime or right if you want to decline his offer"), 1, 7000}})
   343 	table.insert(dialog01, {func = ShowMission, args = {missionName, loc("Ready for Battle?"), loc("Walk left if you want to join Captain Lime or right if you want to decline his offer"), 1, 7000}})
   336 	table.insert(dialog01, {func = AnimSwitchHog, args = {hero.gear}})
   344 	table.insert(dialog01, {func = AnimSwitchHog, args = {hero.gear}})