share/hedgewars/Data/Scripts/Multiplayer/Construction_Mode.lua
changeset 11717 f35139700d22
parent 11716 c7cdd98bb1ec
child 11718 f699978eae19
equal deleted inserted replaced
11716:c7cdd98bb1ec 11717:f35139700d22
   164 wCol = {}
   164 wCol = {}
   165 margin = 20
   165 margin = 20
   166 
   166 
   167 vTag = {}
   167 vTag = {}
   168 lastWep = nil
   168 lastWep = nil
       
   169 
       
   170 checkForSpecialWeaponsIn = -1
   169 
   171 
   170 function HideTags()
   172 function HideTags()
   171 
   173 
   172 	for i = 0, 2 do
   174 	for i = 0, 2 do
   173 		SetVisualGearValues(vTag[i],0,0,0,0,0,1,0, 0, 240000, 0xffffff00)
   175 		SetVisualGearValues(vTag[i],0,0,0,0,0,1,0, 0, 240000, 0xffffff00)
  1433 		end
  1435 		end
  1434 
  1436 
  1435 		if (CurrentHedgehog ~= nil) and (TurnTimeLeft ~= TurnTime) then
  1437 		if (CurrentHedgehog ~= nil) and (TurnTimeLeft ~= TurnTime) then
  1436 			if (lastWep ~= GetCurAmmoType()) then
  1438 			if (lastWep ~= GetCurAmmoType()) then
  1437 				checkForSpecialWeapons()
  1439 				checkForSpecialWeapons()
       
  1440 			elseif checkForSpecialWeaponsIn == 0 then
       
  1441 				checkForSpecialWeapons()
       
  1442 				checkForSpecialWeaponsIn = -1
       
  1443 			else
       
  1444 				checkForSpecialWeaponsIn = checkForSpecialWeaponsIn - 1
  1438 			end
  1445 			end
  1439 		end
  1446 		end
  1440 
  1447 
  1441 		genTimer = genTimer + 1
  1448 		genTimer = genTimer + 1
  1442 
  1449 
  1617 
  1624 
  1618 	AddCaption(loc("Cost") .. ": " .. placedExpense,0xffba00ff,capgrpAmmostate)
  1625 	AddCaption(loc("Cost") .. ": " .. placedExpense,0xffba00ff,capgrpAmmostate)
  1619 
  1626 
  1620 end
  1627 end
  1621 
  1628 
       
  1629 function onTimer(key)
       
  1630 
       
  1631 	checkForSpecialWeaponsIn = 1
       
  1632 
       
  1633 end
       
  1634 
  1622 function onLeft()
  1635 function onLeft()
  1623 
  1636 
  1624 	pIndex = pIndex - 1
  1637 	pIndex = pIndex - 1
  1625 	if pIndex == 0 then
  1638 	if pIndex == 0 then
  1626 		pIndex = #pMode
  1639 		pIndex = #pMode