share/hedgewars/Data/Maps/CTF_Blizzard/map.lua
changeset 4843 673f74c89687
parent 4786 71fb9189d91c
child 4871 4a99a45ea886
equal deleted inserted replaced
4842:65eae3df18ac 4843:673f74c89687
     1 --------------------------------
     1 --------------------------------
     2 -- CTF_BLIZZARD 0.4
     2 -- CTF_BLIZZARD 0.6
     3 --------------------------------
     3 --------------------------------
     4 
     4 
     5 ---------
     5 ---------
     6 -- 0.2
     6 -- 0.2
     7 ---------
     7 ---------
    58 -- added effects to the teleporters
    58 -- added effects to the teleporters
    59 -- added aura round spawning area
    59 -- added aura round spawning area
    60 -- changed the aura around the flag carrier / flag to an aura and added some support for this
    60 -- changed the aura around the flag carrier / flag to an aura and added some support for this
    61 -- changed things so the seed is no longer always the same...
    61 -- changed things so the seed is no longer always the same...
    62 
    62 
       
    63 ---------
       
    64 -- 0.6
       
    65 ---------
       
    66 
       
    67 -- removed branding and version number
       
    68 -- removed teleport from starting weapons
       
    69 -- increased captures to 3
    63 
    70 
    64 loadfile(GetDataPath() .. "Scripts/Locale.lua")()
    71 loadfile(GetDataPath() .. "Scripts/Locale.lua")()
    65 
    72 
    66 ---------------------------------------------------------------
    73 ---------------------------------------------------------------
    67 ----------lots of bad variables and things
    74 ----------lots of bad variables and things
   143 
   150 
   144 function ManageTeleporterEffects()
   151 function ManageTeleporterEffects()
   145 	effectTimer = effectTimer + 1
   152 	effectTimer = effectTimer + 1
   146 	if effectTimer > 50 then -- 100
   153 	if effectTimer > 50 then -- 100
   147 		effectTimer = 0
   154 		effectTimer = 0
   148 		
   155 
   149 		for i = 0,1 do		
   156 		for i = 0,1 do
   150 			eX = 10 + zXMin[i] + GetRandom(zWidth[i]-10)
   157 			eX = 10 + zXMin[i] + GetRandom(zWidth[i]-10)
   151 			eY = 50 + zYMin[i] + GetRandom(zHeight[i]-110)
   158 			eY = 50 + zYMin[i] + GetRandom(zHeight[i]-110)
   152 
   159 
   153 	-- steam and smoke and DUST look good, smokering looks trippy 
   160 	-- steam and smoke and DUST look good, smokering looks trippy
   154 	-- smoketrace and eviltrace are not effected by wind?
   161 	-- smoketrace and eviltrace are not effected by wind?
   155 	-- chunk is a LR falling gear
   162 	-- chunk is a LR falling gear
   156 			tempE = AddVisualGear(eX, eY, vgtDust, 0, false)
   163 			tempE = AddVisualGear(eX, eY, vgtDust, 0, false)
   157 			if tempE ~= 0 then
   164 			if tempE ~= 0 then
   158 				g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(tempE)
   165 				g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(tempE)
   159 				SetVisualGearValues(tempE, eX, eY, g3, g4, g5, g6, g7, g8, g9, fCol[i])
   166 				SetVisualGearValues(tempE, eX, eY, g3, g4, g5, g6, g7, g8, g9, fCol[i])
   160 			end
   167 			end
   161 		end
   168 		end
   162 	end 
   169 	end
   163 end
   170 end
   164 
   171 
   165 function CreateZone(xMin, yMin, width, height)
   172 function CreateZone(xMin, yMin, width, height)
   166 
   173 
   167 
   174 
   201 	elseif teamID == 1 then
   208 	elseif teamID == 1 then
   202 		alt = 0
   209 		alt = 0
   203 		winner = "Blue"
   210 		winner = "Blue"
   204 	end
   211 	end
   205 
   212 
   206 	if fCaptures[teamID] == 2 then
   213 	if fCaptures[teamID] == 3 then
   207 		for i = 0, (numhhs-1) do
   214 		for i = 0, (numhhs-1) do
   208 			if GetHogClan(hhs[i]) == alt then
   215 			if GetHogClan(hhs[i]) == alt then
   209 				SetEffect(hhs[i], heResurrectable, false)
   216 				SetEffect(hhs[i], heResurrectable, false)
   210 				SetHealth(hhs[i],0)
   217 				SetHealth(hhs[i],0)
   211 			end
   218 			end
   257 				fIsMissing[wtf] = false
   264 				fIsMissing[wtf] = false
   258 				fNeedsRespawn[wtf] = true
   265 				fNeedsRespawn[wtf] = true
   259 				fIsMissing[bbq] = false
   266 				fIsMissing[bbq] = false
   260 				fNeedsRespawn[bbq] = true
   267 				fNeedsRespawn[bbq] = true
   261 				fCaptures[wtf] = fCaptures[wtf] +1					--fCaptures[wtf]
   268 				fCaptures[wtf] = fCaptures[wtf] +1					--fCaptures[wtf]
   262 				
   269 
   263 				--ShowMission(loc("You have SCORED!!"), "Red Team: " .. fCaptures[0], "Blue Team: " .. fCaptures[1], -amBazooka, 0)
   270 				--ShowMission(loc("You have SCORED!!"), "Red Team: " .. fCaptures[0], "Blue Team: " .. fCaptures[1], -amBazooka, 0)
   264 				ShowMission(loc("You have SCORED!!"), GetHogTeamName(CurrentHedgehog) .. ": " .. fCaptures[wtf], loc("Opposing Team: ") .. fCaptures[bbq], 0, 0)
   271 				ShowMission(loc("You have SCORED!!"), GetHogTeamName(CurrentHedgehog) .. ": " .. fCaptures[wtf], loc("Opposing Team: ") .. fCaptures[bbq], 0, 0)
   265 
   272 
   266 				PlaySound(sndVictory)
   273 				PlaySound(sndVictory)
   267 				--SetEffect(fThief[bbq], hePoisoned, false)
   274 				--SetEffect(fThief[bbq], hePoisoned, false)
   349 	end
   356 	end
   350 
   357 
   351 end
   358 end
   352 
   359 
   353 function HandleCircles()
   360 function HandleCircles()
   354 	
   361 
   355 	for i = 0, 1 do
   362 	for i = 0, 1 do
   356 		if fIsMissing[i] == false then -- draw a circle at the flag's spawning place
   363 		if fIsMissing[i] == false then -- draw a circle at the flag's spawning place
   357 			--SetVisualGearValues(fCirc[i], fSpawnX[i],fSpawnY[i], 20, 200, 0, 0, 100, 33, 2, fCol[i])
   364 			--SetVisualGearValues(fCirc[i], fSpawnX[i],fSpawnY[i], 20, 200, 0, 0, 100, 33, 2, fCol[i])
   358 			SetVisualGearValues(fCirc[i], fSpawnX[i],fSpawnY[i], vCircMinA[i], vCircMaxA[i], vCircType[i], vCircPulse[i], vCircFuckAll[i], vCircRadius[i], vCircWidth[i], vCircCol[i])
   365 			SetVisualGearValues(fCirc[i], fSpawnX[i],fSpawnY[i], vCircMinA[i], vCircMaxA[i], vCircType[i], vCircPulse[i], vCircFuckAll[i], vCircRadius[i], vCircWidth[i], vCircCol[i])
   359 		elseif (fIsMissing[i] == true) and (fNeedsRespawn[i] == false) then
   366 		elseif (fIsMissing[i] == true) and (fNeedsRespawn[i] == false) then
   363 			elseif fThief[i] == nil then -- draw cirle round dropped flag
   370 			elseif fThief[i] == nil then -- draw cirle round dropped flag
   364 				--SetVisualGearValues(fCirc[i], GetX(fGear[i]), GetY(fGear[i]), 20, 200, 0, 0, 100, 33, 2, fCol[i])
   371 				--SetVisualGearValues(fCirc[i], GetX(fGear[i]), GetY(fGear[i]), 20, 200, 0, 0, 100, 33, 2, fCol[i])
   365 				SetVisualGearValues(fCirc[i], GetX(fGear[i]),GetY(fGear[i]), vCircMinA[i], vCircMaxA[i], vCircType[i], vCircPulse[i], vCircFuckAll[i], vCircRadius[i], vCircWidth[i], vCircCol[i])
   372 				SetVisualGearValues(fCirc[i], GetX(fGear[i]),GetY(fGear[i]), vCircMinA[i], vCircMaxA[i], vCircType[i], vCircPulse[i], vCircFuckAll[i], vCircRadius[i], vCircWidth[i], vCircCol[i])
   366 			end
   373 			end
   367 		end
   374 		end
   368 		
   375 
   369 		if fNeedsRespawn[i] == true then -- if the flag has been destroyed, no need for a circle
   376 		if fNeedsRespawn[i] == true then -- if the flag has been destroyed, no need for a circle
   370 			SetVisualGearValues(fCirc[i], fSpawnX[i],fSpawnY[i], 20, 200, 0, 0, 100, 0, 0, fCol[i])
   377 			SetVisualGearValues(fCirc[i], fSpawnX[i],fSpawnY[i], 20, 200, 0, 0, 100, 0, 0, fCol[i])
   371 		end
   378 		end
   372 	end
   379 	end
   373 
   380 
   540 
   547 
   541 
   548 
   542 function onGameStart()
   549 function onGameStart()
   543 
   550 
   544 	--ShowMission(loc(caption), loc(subcaption), loc(goal), 0, 0)
   551 	--ShowMission(loc(caption), loc(subcaption), loc(goal), 0, 0)
   545 	ShowMission(loc("CTF_BLIZZARD") .. " 0.5", loc("by mikade"), loc(" - Return the enemy flag to your base to score | - First team to 3 captures wins | - You may only score when your flag is in your base | - Hogs will drop the flag if killed, or drowned | - Dropped flags may be returned or recaptured | - Hogs respawn when killed"), 0, 0)
   552 	ShowMission(loc("CTF_BLIZZARD"), "", loc(" - Return the enemy flag to your base to score | - First team to 3 captures wins | - You may only score when your flag is in your base | - Hogs will drop the flag if killed, or drowned | - Dropped flags may be returned or recaptured | - Hogs respawn when killed"), 0, 0)
   546 
   553 
   547 
   554 
   548 	-- initialize teleporters
   555 	-- initialize teleporters
   549 	redTel = CreateZone(342,1316,42,449)	-- red teleporter
   556 	redTel = CreateZone(342,1316,42,449)	-- red teleporter
   550 	orangeTel = CreateZone(3719,1330,45,449)	-- orange teleporter
   557 	orangeTel = CreateZone(3719,1330,45,449)	-- orange teleporter
   586 	fSpawnY[1] = 1747
   593 	fSpawnY[1] = 1747
   587 
   594 
   588 	for i = 0, 1 do
   595 	for i = 0, 1 do
   589 		fGear[i] = SpawnAmmoCrate(fSpawnX[i],fSpawnY[i],amSkip)
   596 		fGear[i] = SpawnAmmoCrate(fSpawnX[i],fSpawnY[i],amSkip)
   590 		fCirc[i] = AddVisualGear(fSpawnX[i],fSpawnY[i],vgtCircle,0,true)
   597 		fCirc[i] = AddVisualGear(fSpawnX[i],fSpawnY[i],vgtCircle,0,true)
   591 		fCol[i] = GetClanColor(i)	
   598 		fCol[i] = GetClanColor(i)
   592 
   599 
   593 		fSpawnC[i] = AddVisualGear(fSpawnX[i],fSpawnY[i],vgtCircle,0,true)
   600 		fSpawnC[i] = AddVisualGear(fSpawnX[i],fSpawnY[i],vgtCircle,0,true)
   594 		SetVisualGearValues(fSpawnC[i], fSpawnX[i],fSpawnY[i], 10, 200, 1, 10, 0, 300, 5, fCol[i])		
   601 		SetVisualGearValues(fSpawnC[i], fSpawnX[i],fSpawnY[i], 10, 200, 1, 10, 0, 300, 5, fCol[i])
   595 		
   602 
   596 	
   603 
   597 		fIsMissing[i] = false
   604 		fIsMissing[i] = false
   598 		fNeedsRespawn[i] = false
   605 		fNeedsRespawn[i] = false
   599 		fCaptures[i] = 0
   606 		fCaptures[i] = 0
   600 
   607 
   601 		vCircMinA[i] = 20
   608 		vCircMinA[i] = 20
   631 	--AddCaption("Handling respawns")
   638 	--AddCaption("Handling respawns")
   632 	HandleRespawns()
   639 	HandleRespawns()
   633 	HandleCrateDrops()
   640 	HandleCrateDrops()
   634 
   641 
   635 	--myC = AddVisualGear(GetX(CurrentHedgehog),GetY(CurrentHedgehog),vgtCircle,0,true)
   642 	--myC = AddVisualGear(GetX(CurrentHedgehog),GetY(CurrentHedgehog),vgtCircle,0,true)
   636 	--SetVisualGearValues(myC, GetX(CurrentHedgehog),GetY(CurrentHedgehog), 20, 200, 0, 0, 100, 50, 3, GetClanColor(GetHogClan(CurrentHedgehog)))	
   643 	--SetVisualGearValues(myC, GetX(CurrentHedgehog),GetY(CurrentHedgehog), 20, 200, 0, 0, 100, 50, 3, GetClanColor(GetHogClan(CurrentHedgehog)))
   637 
   644 
   638 end
   645 end
   639 
   646 
   640 function onGameTick()
   647 function onGameTick()
   641 
   648 
   689 	SetAmmo(amGirder, 2, 0, 0, 2)
   696 	SetAmmo(amGirder, 2, 0, 0, 2)
   690 	SetAmmo(amPortalGun, 2, 0, 0, 2)
   697 	SetAmmo(amPortalGun, 2, 0, 0, 2)
   691 
   698 
   692 	SetAmmo(amParachute, 9, 0, 0, 0)
   699 	SetAmmo(amParachute, 9, 0, 0, 0)
   693 	SetAmmo(amRope, 9, 0, 0, 0)
   700 	SetAmmo(amRope, 9, 0, 0, 0)
   694 	SetAmmo(amTeleport, 1, 0, 0, 1)
   701 	SetAmmo(amTeleport, 0, 0, 0, 1)
   695 	SetAmmo(amJetpack, 1, 0, 0, 1)
   702 	SetAmmo(amJetpack, 1, 0, 0, 1)
   696 
   703 
   697 	SetAmmo(amSwitch, 2, 0, 0, 1)
   704 	SetAmmo(amSwitch, 2, 0, 0, 1)
   698 	SetAmmo(amExtraTime,1,0,0,1)
   705 	SetAmmo(amExtraTime,1,0,0,1)
   699 	SetAmmo(amLowGravity,1,0,0,0)
   706 	SetAmmo(amLowGravity,1,0,0,0)
   717 	if GetHogClan(gear) == 0 then
   724 	if GetHogClan(gear) == 0 then
   718 		FindPlace(gear, false, 0, 2048)
   725 		FindPlace(gear, false, 0, 2048)
   719 	elseif GetHogClan(gear) == 1 then
   726 	elseif GetHogClan(gear) == 1 then
   720 		FindPlace(gear, false, 2048, LAND_WIDTH)
   727 		FindPlace(gear, false, 2048, LAND_WIDTH)
   721 	end
   728 	end
   722 	
   729 
   723 	AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false)
   730 	AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false)
   724 
   731 
   725 end
   732 end
   726 
   733 
   727 function onGearDamage(gear, damage)
   734 function onGearDamage(gear, damage)
   728 
   735 
   729 	-- >_< damn, occurs too fast, before the hog has finished moving / updated his health	
   736 	-- >_< damn, occurs too fast, before the hog has finished moving / updated his health
   730 	--if GetGearType(gear) == gtHedgehog then
   737 	--if GetGearType(gear) == gtHedgehog then
   731 	--	if damage > GetHealth(gear) then
   738 	--	if damage > GetHealth(gear) then
   732 	--		AddVisualGear(GetX(gear), GetY(gear), vgtExplosion, 0, false)		
   739 	--		AddVisualGear(GetX(gear), GetY(gear), vgtExplosion, 0, false)
   733 	--	end
   740 	--	end
   734 	--end
   741 	--end
   735 
   742 
   736 end
   743 end
   737 
   744