share/hedgewars/Data/Missions/Scenario/portal.lua
changeset 14650 5931aff25837
parent 14649 e7b2542c4d28
child 14651 7dbf528ed6a0
equal deleted inserted replaced
14649:e7b2542c4d28 14650:5931aff25837
     1 HedgewarsScriptLoad("/Scripts/Locale.lua")
     1 HedgewarsScriptLoad("/Scripts/Locale.lua")
     2 HedgewarsScriptLoad("/Scripts/Utils.lua")
     2 HedgewarsScriptLoad("/Scripts/Utils.lua")
     3 
     3 
     4 local MineArray = {}
     4 local MineArray = {}
     5 local player
     5 local player
     6 local adviceGiven = false
     6 local adviceGiven0 = false
       
     7 local adviceGiven1 = false
     7 local adviceGiven2 = false
     8 local adviceGiven2 = false
     8 
     9 
     9 function onGameInit()
    10 function onGameInit()
    10 	Seed = 0 -- The base number for the random number generator
    11 	Seed = 0 -- The base number for the random number generator
    11 	GameFlags = gfInfAttack +gfBorder +gfDisableWind +gfSolidLand
    12 	GameFlags = gfInfAttack +gfBorder +gfDisableWind +gfSolidLand
   164 	ShowMission (loc("Portal Mind Challenge"), loc("Scenario"),
   165 	ShowMission (loc("Portal Mind Challenge"), loc("Scenario"),
   165 		loc("Defeat all enemies!") .. "|" ..
   166 		loc("Defeat all enemies!") .. "|" ..
   166 		loc("In this mission you have infinite time.") .. "|" ..
   167 		loc("In this mission you have infinite time.") .. "|" ..
   167 		loc("Mines time: 0 seconds"),
   168 		loc("Mines time: 0 seconds"),
   168 		-amPortalGun, 5000)
   169 		-amPortalGun, 5000)
   169 	HogSay(player, loc("I should get myself a portal device, maybe this crate has one."), SAY_THINK)
   170 end
   170 
   171 
       
   172 function onNewTurn()
       
   173 	if (adviceGiven0 == false) then
       
   174 		adviceGiven0 = true
       
   175 		HogSay(player, loc("I should get myself a portal device, maybe this crate has one."), SAY_THINK)
       
   176 	end
   171 end
   177 end
   172 
   178 
   173 function onGameTick()
   179 function onGameTick()
   174 
   180 
   175 	if (player ~= nil)  then
   181 	if (player ~= nil)  then
   176 		if (gearIsInBox(player, 1650, 1907, 200, 60) and (adviceGiven == false)) then
   182 		if (gearIsInBox(player, 1650, 1907, 200, 60) and (adviceGiven1 == false)) then
   177 			adviceGiven = true
   183 			adviceGiven1 = true
   178 			HogSay(player, loc("Hmmm, I’ll have to find some way of moving him off this anti-portal surface."), SAY_THINK)
   184 			HogSay(player, loc("Hmmm, I’ll have to find some way of moving him off this anti-portal surface."), SAY_THINK)
   179 		elseif (gearIsInBox(player, 2960, 790, 200, 60) and (adviceGiven2 == false)) then
   185 		elseif (gearIsInBox(player, 2960, 790, 200, 60) and (adviceGiven2 == false)) then
   180 			adviceGiven2 = true
   186 			adviceGiven2 = true
   181 			HogSay(player, loc("The anti-portal surface is all over the floor, and I have nothing to kill him. Dropping something could hurt him enough to kill him."), SAY_THINK)
   187 			HogSay(player, loc("The anti-portal surface is all over the floor, and I have nothing to kill him. Dropping something could hurt him enough to kill him."), SAY_THINK)
   182 		end
   188 		end