share/hedgewars/Data/Maps/Control/map.lua
branch0.9.15
changeset 4698 6f14ef3e40ae
parent 4662 63aafc9c2a81
child 4767 4ee4a49549e2
equal deleted inserted replaced
4696:4102737cf2ac 4698:6f14ef3e40ae
    22 -- 0.3
    22 -- 0.3
    23 ---------
    23 ---------
    24 
    24 
    25 -- added translation support
    25 -- added translation support
    26 
    26 
       
    27 --------
       
    28 -- 0.4
       
    29 --------
       
    30 
       
    31 -- added scaling scoring based on clans: 300 points to win - 25 per team in game
       
    32 
    27 -----------------
    33 -----------------
    28 --script begins
    34 --script begins
    29 -----------------
    35 -----------------
    30 
    36 
    31 loadfile(GetDataPath() .. "Scripts/Locale.lua")()
    37 loadfile(GetDataPath() .. "Scripts/Locale.lua")()
    35 ----------because someone is too lazy
    41 ----------because someone is too lazy
    36 ----------to read about tables properly
    42 ----------to read about tables properly
    37 ------------------ "Oh well, they probably have the memory"
    43 ------------------ "Oh well, they probably have the memory"
    38 
    44 
    39 local gameWon = false
    45 local gameWon = false
       
    46 local pointLimit = 300
    40 
    47 
    41 local vCirc = {}
    48 local vCirc = {}
    42 local vCircCount = 0
    49 local vCircCount = 0
    43 
    50 
    44 local hGCount = 0
    51 local hGCount = 0
   277 end
   284 end
   278 
   285 
   279 
   286 
   280 function onGameStart()
   287 function onGameStart()
   281 
   288 
   282 	ShowMission(loc("CONTROL v0.3"), loc("by mikade"), loc("Control pillars to score points."), 0, 0)
   289 	
   283 
       
   284 
   290 
   285 	-- build zones
   291 	-- build zones
   286 	cPoint[0] = CreateZone(571,47,120,80)
   292 	cPoint[0] = CreateZone(571,47,120,80)
   287 	cPoint[1] = CreateZone(1029,643,120,80)
   293 	cPoint[1] = CreateZone(1029,643,120,80)
   288 	cPoint[2] = CreateZone(322,1524,120,80)
   294 	cPoint[2] = CreateZone(322,1524,120,80)
   316 					--minO,max0 -glowyornot	--pulsate timer	 -- fuckall      -- radius -- width  -- colour
   322 					--minO,max0 -glowyornot	--pulsate timer	 -- fuckall      -- radius -- width  -- colour
   317 
   323 
   318 	--new improved placement schematics aw yeah
   324 	--new improved placement schematics aw yeah
   319 	RebuildTeamInfo()
   325 	RebuildTeamInfo()
   320 
   326 
   321 
   327 	for i = 0, (numTeams-1) do
       
   328 		pointLimit = pointLimit - 25
       
   329 	end
   322 	--SetGearPosition(hhs[0], 631, 82)
   330 	--SetGearPosition(hhs[0], 631, 82)
   323 	--SetGearPosition(hhs[1], 1088, 684)
   331 	--SetGearPosition(hhs[1], 1088, 684)
   324 	--SetGearPosition(hhs[2], 381, 1569)
   332 	--SetGearPosition(hhs[2], 381, 1569)
   325 
   333 
   326 	-- reposition hogs if they are on control points until they are not or sanity limit kicks in
   334 	-- reposition hogs if they are on control points until they are not or sanity limit kicks in
   335 			reN = 15		
   343 			reN = 15		
   336 		end
   344 		end
   337 		--AddCaption(zz) -- number of times it took to work
   345 		--AddCaption(zz) -- number of times it took to work
   338 	end
   346 	end
   339 
   347 
       
   348 	ShowMission(loc("CONTROL v0.3"), loc("by mikade"), loc("Control pillars to score points.") .. "|" .. loc("Goal:") .. " " .. pointLimit .. " " .. loc("points"), 0, 0)
       
   349 
       
   350 
   340 end
   351 end
   341 
   352 
   342 
   353 
   343 function onNewTurn()
   354 function onNewTurn()
   344 
   355 
   348 	end
   359 	end
   349 
   360 
   350 	if gameWon == false then
   361 	if gameWon == false then
   351 	
   362 	
   352 		for i = 0, (numTeams-1) do
   363 		for i = 0, (numTeams-1) do
   353 			if teamScore[i] >= 150 then
   364 			if teamScore[i] >= pointLimit then --150
   354 				gameWon = true
   365 				gameWon = true
   355 				winnerClan = i			
   366 				winnerClan = i			
   356 			end
   367 			end
   357 		end
   368 		end
   358 
   369