share/hedgewars/Data/Maps/CTF_Blizzard/map.lua
changeset 14974 2eea2c370389
parent 14973 e50943f1d0af
child 14975 fdfe8bf91b8b
equal deleted inserted replaced
14973:e50943f1d0af 14974:2eea2c370389
   153 
   153 
   154 --------------------------------
   154 --------------------------------
   155 --zone and teleporter variables
   155 --zone and teleporter variables
   156 --------------------------------
   156 --------------------------------
   157 
   157 
   158 local redTel
   158 local leftTel
   159 local orangeTel
   159 local rightTel
   160 
   160 
   161 local zXMin = {}
   161 local zXMin = {}
   162 local zWidth = {}
   162 local zWidth = {}
   163 local zYMin = {}
   163 local zYMin = {}
   164 local zHeight = {}
   164 local zHeight = {}
   173 function ManageTeleporterEffects()
   173 function ManageTeleporterEffects()
   174 	effectTimer = effectTimer + 1
   174 	effectTimer = effectTimer + 1
   175 	if effectTimer > 50 then
   175 	if effectTimer > 50 then
   176 		effectTimer = 0
   176 		effectTimer = 0
   177 
   177 
   178 		for i = 0,1 do
   178 		local i = GetHogClan(CurrentHedgehog)
   179 			local eX = 10 + zXMin[i] + GetRandom(zWidth[i]-10)
   179 		if i ~= 0 and i ~= 1 then
   180 			local eY = 50 + zYMin[i] + GetRandom(zHeight[i]-110)
   180 			return
   181 
   181 		end
   182 			-- steam and smoke and DUST look good, smokering looks trippy
   182 		local eX = 10 + zXMin[i] + GetRandom(zWidth[i]-10)
   183 			-- smoketrace and eviltrace are not effected by wind?
   183 		local eY = 50 + zYMin[i] + GetRandom(zHeight[i]-110)
   184 			-- chunk is a LR falling gear
   184 
   185 			local tempE = AddVisualGear(eX, eY, vgtDust, 0, false)
   185 		-- steam and smoke and DUST look good, smokering looks trippy
   186 			SetVisualGearValues(tempE, eX, eY, nil, nil, nil, nil, nil, nil, nil, fCol[i])
   186 		-- smoketrace and eviltrace are not effected by wind?
   187 		end
   187 		-- chunk is a LR falling gear
       
   188 		local tempE = AddVisualGear(eX, eY, vgtDust, 0, false)
       
   189 		SetVisualGearValues(tempE, eX, eY, nil, nil, nil, nil, nil, nil, nil, fCol[i])
   188 	end
   190 	end
   189 end
   191 end
   190 
   192 
   191 function CreateZone(xMin, yMin, width, height)
   193 function CreateZone(xMin, yMin, width, height)
   192 
   194 
   402 
   404 
   403 function CheckTeleporters()
   405 function CheckTeleporters()
   404 
   406 
   405 	local teleportActive = false
   407 	local teleportActive = false
   406 
   408 
   407 	if (GearIsInZone(CurrentHedgehog, redTel) == true) and (GetHogClan(CurrentHedgehog) == 0) then
   409 	if (GearIsInZone(CurrentHedgehog, leftTel) == true) and (GetHogClan(CurrentHedgehog) == 0) then
   408 		teleportActive = true
   410 		teleportActive = true
   409 		destinationX = 1402
   411 		destinationX = 1402
   410 		destinationY = 321
   412 		destinationY = 321
   411 	elseif (GearIsInZone(CurrentHedgehog, orangeTel) == true) and (GetHogClan(CurrentHedgehog) == 1) then
   413 	elseif (GearIsInZone(CurrentHedgehog, rightTel) == true) and (GetHogClan(CurrentHedgehog) == 1) then
   412 		teleportActive = true
   414 		teleportActive = true
   413 		destinationX = 2692
   415 		destinationX = 2692
   414 		destinationY = 321
   416 		destinationY = 321
   415 	end
   417 	end
   416 
   418 
   537 		loc("- Dropped flags may be returned or recaptured").."|"..
   539 		loc("- Dropped flags may be returned or recaptured").."|"..
   538 		loc("- Hogs will be revived") .."|"..
   540 		loc("- Hogs will be revived") .."|"..
   539 		loc("- Enter the sparkling forcefield to teleport"), 0, 0)
   541 		loc("- Enter the sparkling forcefield to teleport"), 0, 0)
   540 
   542 
   541 	-- initialize teleporters
   543 	-- initialize teleporters
   542 	redTel = CreateZone(342,1316,42,449)	-- red teleporter
   544 	leftTel = CreateZone(342,1316,42,449)	-- left teleporter (clan 0)
   543 	orangeTel = CreateZone(3719,1330,45,449)	-- orange teleporter
   545 	rightTel = CreateZone(3719,1330,45,449)	-- right teleporter (clan 1)
   544 
   546 
   545 
   547 
   546 	--new improved placement schematics aw yeah
   548 	--new improved placement schematics aw yeah
   547 	RebuildTeamInfo()
   549 	RebuildTeamInfo()
   548 	local team1Placed = 0
   550 	local team1Placed = 0
   638 	if (CurrentHedgehog ~= nil) then
   640 	if (CurrentHedgehog ~= nil) then
   639 		CheckTeleporters()
   641 		CheckTeleporters()
   640 	end
   642 	end
   641 
   643 
   642 	HandleCircles()
   644 	HandleCircles()
   643 	ManageTeleporterEffects()
   645 	if (CurrentHedgehog ~= nil) then
       
   646 		ManageTeleporterEffects()
       
   647 	end
   644 
   648 
   645 end
   649 end
   646 
   650 
   647 
   651 
   648 function onAmmoStoreInit()
   652 function onAmmoStoreInit()