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