share/hedgewars/Data/Maps/CTF_Blizzard/map.lua
changeset 13117 cd1561b0337f
parent 13116 3b7cd18c4a06
child 13630 fe7d2bbf5f3f
equal deleted inserted replaced
13116:3b7cd18c4a06 13117:cd1561b0337f
   433 			if ropeGear ~= nil then
   433 			if ropeGear ~= nil then
   434 				if GetGearElasticity(ropeGear) ~= 0 then
   434 				if GetGearElasticity(ropeGear) ~= 0 then
   435 					SetGearMessage(CurrentHedgehog, gmAttack)
   435 					SetGearMessage(CurrentHedgehog, gmAttack)
   436 				end
   436 				end
   437 			end
   437 			end
   438 			--AddCaption(actionReset .. ";" .. "attack")
       
   439 		elseif actionReset == 10 then
   438 		elseif actionReset == 10 then
   440 			SetGearMessage(CurrentHedgehog, 0)
   439 			SetGearMessage(CurrentHedgehog, 0)
   441 			--AddCaption(actionReset .. ";" .. "reset")
       
   442 		elseif actionReset == 20 then
   440 		elseif actionReset == 20 then
   443 			AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtBigExplosion, 0, false)
   441 			AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtBigExplosion, 0, false)
   444 			SetGearPosition(CurrentHedgehog,destinationX,destinationY)
   442 			SetGearPosition(CurrentHedgehog,destinationX,destinationY)
   445 			AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtBigExplosion, 0, false)
   443 			AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtBigExplosion, 0, false)
   446 			--AddCaption(actionReset .. ";" .. "teleport")
       
   447 		end
   444 		end
   448 
   445 
   449 		actionReset = actionReset + 1
   446 		actionReset = actionReset + 1
   450 		if actionReset >= 30 then
   447 		if actionReset >= 30 then
   451 			actionReset = 0
   448 			actionReset = 0
   527 
   524 
   528 function onGameInit()
   525 function onGameInit()
   529 
   526 
   530 	-- Things we don't modify here will use their default values.
   527 	-- Things we don't modify here will use their default values.
   531 	GameFlags = gfDivideTeams -- Game settings and rules
   528 	GameFlags = gfDivideTeams -- Game settings and rules
   532 	TurnTime = 30000 -- (was 30) The time the player has to move each round (in ms)
   529 	TurnTime = 30000 -- The time the player has to move each round (in ms)
   533 	CaseFreq = 0 -- The frequency of crate drops
   530 	CaseFreq = 0 -- The frequency of crate drops
   534 	MinesNum = 0 -- The number of mines being placed
   531 	MinesNum = 0 -- The number of mines being placed
   535 	MinesTime  = 2000
       
   536 	Explosives = 0 -- The number of explosives being placed
   532 	Explosives = 0 -- The number of explosives being placed
   537 	-- Disable Sudden Death
   533 	-- Disable Sudden Death
   538 	WaterRise = 0
   534 	WaterRise = 0
   539 	HealthDecrease = 0
   535 	HealthDecrease = 0
   540 	Map = "Blizzard" -- The map to be played
   536 	Map = "Blizzard" -- The map to be played
   541 	Theme = "Snow" -- The theme to be used "Nature"
   537 	Theme = "Snow" -- The theme to be used
   542 
   538 
   543 end
   539 end
   544 
   540 
   545 
   541 
   546 function onGameStart()
   542 function onGameStart()
   699 
   695 
   700 	AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false)
   696 	AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false)
   701 
   697 
   702 end
   698 end
   703 
   699 
       
   700 local excessHogsWarning = false
       
   701 
   704 function onGearAdd(gear)
   702 function onGearAdd(gear)
   705 
   703 
   706 	if GetGearType(gear) == gtHedgehog then
   704 	if GetGearType(gear) == gtHedgehog then
   707 
   705 
   708 		hhs[numhhs] = gear
   706 		if GetHogClan(gear) > 1 then
   709 		numhhs = numhhs + 1
   707 			DeleteGear(gear)
   710 		SetEffect(gear, heResurrectable, 1)
   708 			if not excessHogsWarning then
   711 
   709 				WriteLnToChat(loc("Only two clans allowed! Excess hedgehogs will be removed."))
   712 	end
   710 				excessHogsWarning = true
   713 
   711 			end
   714 	if GetGearType(gear) == gtRope then
   712 		else
       
   713 			hhs[numhhs] = gear
       
   714 			numhhs = numhhs + 1
       
   715 			SetEffect(gear, heResurrectable, 1)
       
   716 		end
       
   717 
       
   718 	elseif GetGearType(gear) == gtRope then
   715 		ropeGear = gear
   719 		ropeGear = gear
   716 	end
   720 	end
   717 
   721 
   718 end
   722 end
   719 
   723