share/hedgewars/Data/Scripts/Multiplayer/Construction_Mode.lua
changeset 11710 f74010cb6219
parent 11709 cea5418c1af6
child 11711 bfbf6dc83176
equal deleted inserted replaced
11709:cea5418c1af6 11710:f74010cb6219
   143 clanBoundsSY = {}
   143 clanBoundsSY = {}
   144 clanBoundsEX = {}
   144 clanBoundsEX = {}
   145 clanBoundsEY = {}
   145 clanBoundsEY = {}
   146 
   146 
   147 clanPower = {}
   147 clanPower = {}
   148 clanBoon = {}
       
   149 clanID = {}
   148 clanID = {}
   150 clanLStrucIndex = {}
   149 clanLStrucIndex = {}
   151 
   150 
   152 clanLWepIndex = {} -- for ease of use let's track this stuff
   151 clanLWepIndex = {} -- for ease of use let's track this stuff
   153 clanLUtilIndex = {}
   152 clanLUtilIndex = {}
   162 wY = {}
   161 wY = {}
   163 wWidth = {}
   162 wWidth = {}
   164 wHeight = {}
   163 wHeight = {}
   165 wCol = {}
   164 wCol = {}
   166 margin = 20
   165 margin = 20
   167 
       
   168 tauntString = ""
       
   169 
   166 
   170 vTag = {}
   167 vTag = {}
   171 lastWep = nil
   168 lastWep = nil
   172 
   169 
   173 function HideTags()
   170 function HideTags()
  1584 
  1581 
  1585 	end
  1582 	end
  1586 
  1583 
  1587 end
  1584 end
  1588 
  1585 
  1589 --------------------------------------------------
       
  1590 -- EVENT HANDLERS
       
  1591 --------------------------------------------------
       
  1592 
       
  1593 function onTaunt(t)
       
  1594 	tauntString = tauntString .. t
       
  1595 	if (tauntString == "101") and (clanPower[GetHogClan(CurrentHedgehog)] < 300) and (clanBoon[GetHogClan(CurrentHedgehog)] == false) then
       
  1596 		clanBoon[GetHogClan(CurrentHedgehog)] = true
       
  1597 		clanPower[GetHogClan(CurrentHedgehog)] = 1000
       
  1598 		AddCaption(loc("The Great Hog in the sky sees your sadness and grants you a boon."))
       
  1599 	end
       
  1600 end
       
  1601 
       
  1602 ---------------------------------------------------------------
  1586 ---------------------------------------------------------------
  1603 -- Cycle through selection subsets (by changing pIndex, pMode)
  1587 -- Cycle through selection subsets (by changing pIndex, pMode)
  1604 -- i.e 	health of barrels, medikits,
  1588 -- i.e 	health of barrels, medikits,
  1605 --		timer of mines
  1589 --		timer of mines
  1606 --		contents of crates
  1590 --		contents of crates
  1803 	sCirc = AddVisualGear(0,0,vgtCircle,0,true)
  1787 	sCirc = AddVisualGear(0,0,vgtCircle,0,true)
  1804 	SetVisualGearValues(sCirc, 0, 0, 100, 255, 1, 10, 0, 40, 3, 0x00000000)
  1788 	SetVisualGearValues(sCirc, 0, 0, 100, 255, 1, 10, 0, 40, 3, 0x00000000)
  1805 
  1789 
  1806 	for i = 0, ClansCount-1 do
  1790 	for i = 0, ClansCount-1 do
  1807 		clanPower[i] = 500
  1791 		clanPower[i] = 500
  1808 		clanBoon[i] = false
       
  1809 		clanLWepIndex[i] = 1 -- for ease of use let's track this stuff
  1792 		clanLWepIndex[i] = 1 -- for ease of use let's track this stuff
  1810 		clanLUtilIndex[i] = 1
  1793 		clanLUtilIndex[i] = 1
  1811 		clanLGearIndex[i] = 1
  1794 		clanLGearIndex[i] = 1
  1812 		clanUsedExtraTime[i] = false
  1795 		clanUsedExtraTime[i] = false
  1813 		clanCratesSpawned[i] = 0
  1796 		clanCratesSpawned[i] = 0
  1841 end
  1824 end
  1842 
  1825 
  1843 
  1826 
  1844 function onNewTurn()
  1827 function onNewTurn()
  1845 
  1828 
  1846 	tauntString = ""
       
  1847 	clanPower[GetHogClan(CurrentHedgehog)] = clanPower[GetHogClan(CurrentHedgehog)] + 50
  1829 	clanPower[GetHogClan(CurrentHedgehog)] = clanPower[GetHogClan(CurrentHedgehog)] + 50
  1848 	clanUsedExtraTime[GetHogClan(CurrentHedgehog)] = false
  1830 	clanUsedExtraTime[GetHogClan(CurrentHedgehog)] = false
  1849 	clanCratesSpawned[GetHogClan(CurrentHedgehog)] = 0
  1831 	clanCratesSpawned[GetHogClan(CurrentHedgehog)] = 0
  1850 
  1832 
  1851 end
  1833 end