share/hedgewars/Data/Missions/Training/portal.lua
changeset 11668 991c790da01e
parent 11667 7652eeb0fc7f
child 11669 66ddc8c5ecd7
equal deleted inserted replaced
11667:7652eeb0fc7f 11668:991c790da01e
    15 	Explosives = 0 -- The number of explosives being placed
    15 	Explosives = 0 -- The number of explosives being placed
    16 	Delay = 10 -- The delay between each round
    16 	Delay = 10 -- The delay between each round
    17 	Map = "portal" -- The map to be played
    17 	Map = "portal" -- The map to be played
    18 	Theme = "Hell" -- The theme to be used
    18 	Theme = "Hell" -- The theme to be used
    19 	
    19 	
    20 ----AddTeam(teamname, color, grave, fort, voicepack, flag)--
       
    21 	AddTeam(loc("Subjects"), 0xFFFF01, "Simple", "Island", "Default", "cm_test")
    20 	AddTeam(loc("Subjects"), 0xFFFF01, "Simple", "Island", "Default", "cm_test")
    22 	player = AddHog(loc("Subject 1"), 0, 10, "Terminator_Glasses")
    21 	player = AddHog(loc("Subject 1"), 0, 10, "Terminator_Glasses")
    23 
    22 
    24 	AddTeam(loc("Hell Army"), 0xFF0402, "skull", "Island", "Default", "cm_hellish")
    23 	AddTeam(loc("Hell Army"), 0xFF0402, "skull", "Island", "Default", "cm_hellish")
    25 	enemy1 = AddHog(loc("Lucifer"), 1, 200, "InfernalHorns")
    24 	enemy1 = AddHog(loc("Lucifer"), 1, 200, "InfernalHorns")
    37 	enemy11 = AddHog(loc("Ronald"), 1, 70, "clown")
    36 	enemy11 = AddHog(loc("Ronald"), 1, 70, "clown")
    38 	enemy12 = AddHog(loc("Phosphat"), 1, 50, "chef")
    37 	enemy12 = AddHog(loc("Phosphat"), 1, 50, "chef")
    39 	enemy13 = AddHog(loc("Lestat"), 1, 30, "vampirichog")
    38 	enemy13 = AddHog(loc("Lestat"), 1, 30, "vampirichog")
    40 
    39 
    41 	SetGearPosition(player, 350, 1820)
    40 	SetGearPosition(player, 350, 1820)
    42     SetGearPosition(enemy1, 2037, 1313)
    41 	SetGearPosition(enemy1, 2037, 1313)
    43 	SetGearPosition(enemy2, 1369, 1605)
    42 	SetGearPosition(enemy2, 1369, 1605)
    44 	SetGearPosition(enemy3, 1750, 1937)
    43 	SetGearPosition(enemy3, 1750, 1937)
    45 	SetGearPosition(enemy4, 3125, 89)
    44 	SetGearPosition(enemy4, 3125, 89)
    46 	SetGearPosition(enemy5, 743, 900)
    45 	SetGearPosition(enemy5, 743, 900)
    47 	SetGearPosition(enemy6, 130, 360)
    46 	SetGearPosition(enemy6, 130, 360)
    50 	SetGearPosition(enemy9, 2680, 225)
    49 	SetGearPosition(enemy9, 2680, 225)
    51 	SetGearPosition(enemy10, 2970, 800)
    50 	SetGearPosition(enemy10, 2970, 800)
    52 	SetGearPosition(enemy11, 4050, 1964)
    51 	SetGearPosition(enemy11, 4050, 1964)
    53 	SetGearPosition(enemy12, 2666, 950)
    52 	SetGearPosition(enemy12, 2666, 950)
    54 	SetGearPosition(enemy13, 3306, 1205)
    53 	SetGearPosition(enemy13, 3306, 1205)
    55 
       
    56 
       
    57 
    54 
    58 end
    55 end
    59 
    56 
    60 function onAmmoStoreInit()
    57 function onAmmoStoreInit()
    61 
    58 
    75 	SetAmmo(amSnowball, 0, 0, 0, 1)
    72 	SetAmmo(amSnowball, 0, 0, 0, 1)
    76 
    73 
    77 end
    74 end
    78 
    75 
    79 function onGameStart()
    76 function onGameStart()
    80 
       
    81 	SetWind(100)-- SetWind(windSpeed) Sets the current wind in the range of -100 to 100. Use together with gfDisableWind for full control.
       
    82                 -- -100to0 is to the left, and 0to100 is to the right  (of course more its far from 0, more the speed is high
       
    83 				--  -100.............................0..................................+100
       
    84 				-- <<<<<<<<--<<--<<<<<<<<<<<<<--<<<<<|||-->>>>>>>>-->>>>>>>>>>>>>>>-->>>>>>          =  wind direction
       
    85 
       
    86 
    77 
    87 	MineArray[0] = AddGear(840, 1847, gtMine, 0, 0, 0, 0)
    78 	MineArray[0] = AddGear(840, 1847, gtMine, 0, 0, 0, 0)
    88 	MineArray[1] = AddGear(900, 1847, gtMine, 0, 0, 0, 0)
    79 	MineArray[1] = AddGear(900, 1847, gtMine, 0, 0, 0, 0)
    89 	MineArray[2] = AddGear(1000, 1847, gtMine, 0, 0, 0, 0)
    80 	MineArray[2] = AddGear(1000, 1847, gtMine, 0, 0, 0, 0)
    90 	MineArray[3] = AddGear(1100, 1847, gtMine, 0, 0, 0, 0)
    81 	MineArray[3] = AddGear(1100, 1847, gtMine, 0, 0, 0, 0)
   120 	MineArray[32] = AddGear(1470, 1785, gtMine, 0, 0, 0, 0)
   111 	MineArray[32] = AddGear(1470, 1785, gtMine, 0, 0, 0, 0)
   121 	MineArray[33] = AddGear(1480, 1785, gtMine, 0, 0, 0, 0)
   112 	MineArray[33] = AddGear(1480, 1785, gtMine, 0, 0, 0, 0)
   122 	MineArray[34] = AddGear(1311, 1785, gtMine, 0, 0, 0, 0)
   113 	MineArray[34] = AddGear(1311, 1785, gtMine, 0, 0, 0, 0)
   123 
   114 
   124 	MineArray[35] = AddGear(4029, 89, gtMine, 0, 0, 0, 120)
   115 	MineArray[35] = AddGear(4029, 89, gtMine, 0, 0, 0, 120)
   125 	--MineArray[36] = AddGear(3376, 1947, gtMine, 0, 0, 0, 10)
       
   126 
   116 
   127 		for i = 0,#MineArray do
   117 	for i = 0,#MineArray do
   128 			SetTimer(MineArray[i],050)
   118 		SetTimer(MineArray[i],050)
   129 			SetState(MineArray[i],544)
   119 		SetState(MineArray[i],544)
   130 		end
   120 	end
   131 				--needed this MineArray cause timer didn't work, its was always 3sec, i wanna instant mines
   121 	--needed this MineArray cause timer didn't work, its was always 3sec, i wanna instant mines
   132 
   122 
   133 
   123 	--UTILITY CRATE--
   134 				--UTILITY CRATE--
       
   135 	parachute = SpawnUtilityCrate(1670, 1165, amParachute)
   124 	parachute = SpawnUtilityCrate(1670, 1165, amParachute)
   136 	girder = SpawnUtilityCrate(2101, 1297, amGirder)
   125 	girder = SpawnUtilityCrate(2101, 1297, amGirder)
   137 	SpawnUtilityCrate(3965, 625, amBlowTorch)
   126 	SpawnUtilityCrate(3965, 625, amBlowTorch)
   138 	SpawnUtilityCrate(2249, 93, amBlowTorch)
   127 	SpawnUtilityCrate(2249, 93, amBlowTorch)
   139 	SpawnUtilityCrate(2181, 829, amBlowTorch)
   128 	SpawnUtilityCrate(2181, 829, amBlowTorch)
   142 	SpawnUtilityCrate(130, 600, amPickHammer)
   131 	SpawnUtilityCrate(130, 600, amPickHammer)
   143 	SpawnUtilityCrate(1660,1820, amLaserSight)
   132 	SpawnUtilityCrate(1660,1820, amLaserSight)
   144 	SpawnUtilityCrate(4070,1840, amLaserSight)
   133 	SpawnUtilityCrate(4070,1840, amLaserSight)
   145 	
   134 	
   146 	
   135 	
   147 				--AMMO CRATE--
   136 	--AMMO CRATE--
   148 	portalgun = SpawnAmmoCrate(505, 1943, amPortalGun, 1000)
   137 	portalgun = SpawnAmmoCrate(505, 1943, amPortalGun, 1000)
   149 	extratime = SpawnAmmoCrate(4020, 785, amExtraTime, 2)
   138 	extratime = SpawnAmmoCrate(4020, 785, amExtraTime, 2)
   150 	SpawnAmmoCrate(425, 613, amSnowball)
   139 	SpawnAmmoCrate(425, 613, amSnowball)
   151 	SpawnAmmoCrate(861, 633, amHellishBomb)
   140 	SpawnAmmoCrate(861, 633, amHellishBomb)
   152 	SpawnAmmoCrate(2510, 623, amSnowball)
   141 	SpawnAmmoCrate(2510, 623, amSnowball)
   155 	SpawnAmmoCrate(2650, 80, amDEagle)
   144 	SpawnAmmoCrate(2650, 80, amDEagle)
   156 	SpawnAmmoCrate(3000, 100, amDEagle)
   145 	SpawnAmmoCrate(3000, 100, amDEagle)
   157 	SpawnAmmoCrate(2900, 1400, amRope)
   146 	SpawnAmmoCrate(2900, 1400, amRope)
   158 	SpawnAmmoCrate(4025, 1117, amFirePunch)
   147 	SpawnAmmoCrate(4025, 1117, amFirePunch)
   159 
   148 
   160 	
   149 	--HEALTH CRATE--
   161 				--HEALTH CRATE--
       
   162 	SpawnHealthCrate(2000, 780)
   150 	SpawnHealthCrate(2000, 780)
   163 	
   151 	
   164 				--GIRDER--
   152 	--GIRDER--
   165 	PlaceGirder(3363, 1323, 4)
   153 	PlaceGirder(3363, 1323, 4)
   166 
       
   167 
   154 
   168 	ShowMission (loc("Portal Mind Challenge"), loc("Mission"), 
   155 	ShowMission (loc("Portal Mind Challenge"), loc("Mission"), 
   169 		loc("Defeat all enemies!") .. "|" .. loc("In this mission you have infinite time."),
   156 		loc("Defeat all enemies!") .. "|" .. loc("In this mission you have infinite time."),
   170 		-amPortalGun, 5000)
   157 		-amPortalGun, 5000)
   171 	HogSay(player, loc("I should get myself a portal device, maybe this crate has one."), SAY_THINK)
   158 	HogSay(player, loc("I should get myself a portal device, maybe this crate has one."), SAY_THINK)
   172 	
   159 	
   173 
       
   174 
       
   175 
       
   176 end
   160 end
   177 
   161 
   178 function onGameTick()
   162 function onGameTick()
   179 
   163 
   180     if (player ~= nil)  then
   164 	if (player ~= nil)  then
   181 		if (gearIsInBox(player, 1650, 1907, 200, 60) and (adviceGiven == false)) then
   165 		if (gearIsInBox(player, 1650, 1907, 200, 60) and (adviceGiven == false)) then
   182 			adviceGiven = true
   166 			adviceGiven = true
   183 				HogSay(player, loc("Hmmm, I’ll have to find some way of moving him off this anti-portal surface."), SAY_THINK)
   167 			HogSay(player, loc("Hmmm, I’ll have to find some way of moving him off this anti-portal surface."), SAY_THINK)
   184 		elseif (gearIsInBox(player, 2960, 790, 200, 60) and (adviceGiven2 == false)) then
   168 		elseif (gearIsInBox(player, 2960, 790, 200, 60) and (adviceGiven2 == false)) then
   185 			adviceGiven2 = true
   169 			adviceGiven2 = true
   186 				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)
   170 			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  end
   171 		end
   188  end
       
   189 	
       
   190 	end
   172 	end
   191 	
   173 	
   192 
       
   193 
       
   194 
       
   195 
       
   196 function onNewturn()
       
   197 end
   174 end
   198 
   175 	
   199 
       
   200 function onGearAdd(gear)
       
   201 end
       
   202 
       
   203 function onGearDelete(gear)
   176 function onGearDelete(gear)
   204 
   177 
   205 	if gear == portalgun then
   178 	if gear == portalgun then
   206 		--AddAmmo(player, amPortalGun, 10000)
       
   207 		HogSay(player, loc("Great! Let’s kill all these enemies, using portals."), SAY_THINK)
   179 		HogSay(player, loc("Great! Let’s kill all these enemies, using portals."), SAY_THINK)
   208 	end
   180 	end
   209 
   181 
   210 	if gear == girder then 
   182 	if gear == girder then 
   211 		HogSay(player, loc("This will be useful when I need a new platform or if I want to rise."), SAY_THINK)
   183 		HogSay(player, loc("This will be useful when I need a new platform or if I want to rise."), SAY_THINK)
   212 	end
   184 	end
   213 	
   185 	
   214 	if gear == parachute then
   186 	if gear == parachute then
   215 		HogSay(player, loc("You can’t open a portal on the blue surface."), SAY_THINK)
   187 		HogSay(player, loc("You can’t open a portal on the blue surface."), SAY_THINK)
   216 	end
   188 	end
   217 --if you wanted to check for collection only
       
   218 --you could probably say
       
   219 --if (gear == myParachuteGear) and (band(GetGearMessage(gear), gmDestroy) ~= 0) then
       
   220 
   189 
   221 	if gear == extratime then
   190 	if gear == extratime then
   222 		HogSay(player, loc("What?! For all this struggle I just win some ... time? Oh dear!"), SAY_SHOUT)
   191 		HogSay(player, loc("What?! For all this struggle I just win some ... time? Oh dear!"), SAY_SHOUT)
   223 	end
   192 	end
   224 	
   193 	
   225 	if gear == player then
   194 	if gear == player then
   226         player = nil
   195 		player = nil
   227     end
   196 	end
   228 end
   197 end
   229 
   198 
   230 
       
   231 
       
   232 
       
   233 
       
   234