share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/cosmos.lua
changeset 13099 071dcdf33f86
parent 12933 e65aa3c3d4e6
child 13162 9ec7d2fb9da7
equal deleted inserted replaced
13098:d3e9f3423ef3 13099:071dcdf33f86
    89 teamC.name = loc("Hog Solo")
    89 teamC.name = loc("Hog Solo")
    90 teamC.color = 0x38D61C -- green
    90 teamC.color = 0x38D61C -- green
    91 
    91 
    92 -------------- LuaAPI EVENT HANDLERS ------------------
    92 -------------- LuaAPI EVENT HANDLERS ------------------
    93 function onGameInit()
    93 function onGameInit()
       
    94 	-- get the check point
       
    95 	if tonumber(GetCampaignVar("CosmosCheckPoint")) then
       
    96 		checkPointReached = tonumber(GetCampaignVar("CosmosCheckPoint"))
       
    97 	end
       
    98 
    94 	Seed = 35
    99 	Seed = 35
    95 	GameFlags = gfSolidLand + gfDisableWind + gfTagTeam
   100 	ClearGameFlags()
       
   101 	EnableGameFlags(gfSolidLand, gfDisableWind, gfTagTeam)
       
   102 	if checkPointReached == 4 then
       
   103 		-- Disable walking as long we're stuck on the moon
       
   104 		EnableGameFlags(gfArtillery)
       
   105 	end
    96 	TurnTime = 20000
   106 	TurnTime = 20000
    97 	CaseFreq = 0
   107 	CaseFreq = 0
    98 	MinesNum = 0
   108 	MinesNum = 0
    99 	Explosives = 0
   109 	Explosives = 0
   100 	Delay = 5
   110 	Delay = 5
   124 	AddTeam(teamB.name, teamB.color, "Statue", "Island", "Default", "cm_swordshield2")
   134 	AddTeam(teamB.name, teamB.color, "Statue", "Island", "Default", "cm_swordshield2")
   125 	guard1.gear = AddHog(guard1.name, 1, 100, "policecap")
   135 	guard1.gear = AddHog(guard1.name, 1, 100, "policecap")
   126 	AnimSetGearPosition(guard1.gear, guard1.x, guard1.y)
   136 	AnimSetGearPosition(guard1.gear, guard1.x, guard1.y)
   127 	guard2.gear = AddHog(guard2.name, 1, 100, "policecap")
   137 	guard2.gear = AddHog(guard2.name, 1, 100, "policecap")
   128 	AnimSetGearPosition(guard2.gear, guard2.x, guard2.y)
   138 	AnimSetGearPosition(guard2.gear, guard2.x, guard2.y)
   129 	-- get the check point
       
   130 	if tonumber(GetCampaignVar("CosmosCheckPoint")) then
       
   131 		checkPointReached = tonumber(GetCampaignVar("CosmosCheckPoint"))
       
   132 	end
       
   133 	if checkPointReached == 4 then
       
   134 		-- Disable walking as long we're stuck on the moon
       
   135 		GameFlags = bor(GameFlags, gfArtillery)
       
   136 	end
       
   137 	-- Whether to start with an animation
   139 	-- Whether to start with an animation
   138 	local startSequence
   140 	local startSequence
   139 	-- do checkpoint stuff needed before game starts
   141 	-- do checkpoint stuff needed before game starts
   140 	if checkPointReached == 1 then
   142 	if checkPointReached == 1 then
   141 		-- Start of the game
   143 		-- Start of the game