share/hedgewars/Data/Scripts/Multiplayer/Construction_Mode.lua
changeset 11723 456f4e9f9dce
parent 11722 fc4909039db8
child 11724 cf4d61123440
equal deleted inserted replaced
11722:fc4909039db8 11723:456f4e9f9dce
   814 
   814 
   815 	end
   815 	end
   816 
   816 
   817 	for i = 1, #strucID do
   817 	for i = 1, #strucID do
   818 
   818 
   819 		g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(strucCirc[i])
   819 		SetVisualGearValues(strucCirc[i], GetX(strucGear[i]), GetY(strucGear[i]), nil, nil, nil, nil, nil, strucCircRadius[i], nil, strucCircCol[i])
   820 		SetVisualGearValues(strucCirc[i], GetX(strucGear[i]), GetY(strucGear[i]), g3, g4, g5, g6, g7, strucCircRadius[i], g9, strucCircCol[i])
       
   821 
   820 
   822 		tempID = i
   821 		tempID = i
   823 
   822 
   824 		g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(strucAltDisplay[i])				--8000
   823 		SetVisualGearValues(strucAltDisplay[i], GetX(strucGear[i]), GetY(strucGear[i]), 0, 0, nil, nil, 800000, sprTarget)
   825 		SetVisualGearValues(strucAltDisplay[i], GetX(strucGear[i]), GetY(strucGear[i]), 0, 0, g5, g6, 800000, sprTarget, g9, g10 )
   824 
   826 
   825 		if GameTime % 100 == 0 then
   827 
   826 			-- Check For proximity of stuff to our structures
   828 
   827 			if isAStructureThatAppliesToMultipleGears(i) then
   829 		-- Check For proximity of stuff to our structures
   828 				runOnGears(CheckProximity)
   830 		if isAStructureThatAppliesToMultipleGears(i) then
   829 			else -- only check prox on CurrentHedgehog
   831 			runOnGears(CheckProximity)
   830 				if CurrentHedgehog ~= nil then
   832 		else -- only check prox on CurrentHedgehog
   831 					CheckProximity(CurrentHedgehog)
   833 			CheckProximity(CurrentHedgehog)
   832 				end
   834 		end
   833 			end
   835 
   834 
   836 		if strucType[i] == loc("Reflector Shield") then
   835 			if strucType[i] == loc("Generator") then
   837 
   836 	
   838 		elseif strucType[i] == loc("Generator") then
   837 				for z = 0, ClansCount-1 do
   839 
   838 					if z == strucClan[i] then
   840 			for z = 0, ClansCount-1 do
   839 						increaseGearValue(strucGear[i],"power")
   841 				if z == strucClan[i] then
   840 						if getGearValue(strucGear[i],"power") == 10 then
   842 					increaseGearValue(strucGear[i],"power")
   841 							setGearValue(strucGear[i],"power",0)
   843 					if getGearValue(strucGear[i],"power") == 10 then
   842 							clanPower[z] = clanPower[z] + 1
   844 						setGearValue(strucGear[i],"power",0)
   843 							if clanPower[z] > conf_maxEnergy then
   845 						clanPower[z] = clanPower[z] + 1
   844 								clanPower[z] = conf_maxEnergy
   846 						if clanPower[z] > conf_maxEnergy then
   845 							end
   847 							clanPower[z] = conf_maxEnergy
       
   848 						end
   846 						end
       
   847 	
   849 					end
   848 					end
   850 
       
   851 				end
   849 				end
   852 			end
   850 			end
   853 
   851 
   854 		end
   852 		end
   855 
   853 
  1218 end
  1216 end
  1219 
  1217 
  1220 -- called in onGameTick()
  1218 -- called in onGameTick()
  1221 function HandleHedgeEditor()
  1219 function HandleHedgeEditor()
  1222 
  1220 
       
  1221 	HandleStructures()
       
  1222 
  1223 	if CurrentHedgehog ~= nil then
  1223 	if CurrentHedgehog ~= nil then
  1224 
  1224 
  1225 		if wallsVisible == true then
  1225 		if wallsVisible == true then
  1226 			HandleBorderEffects()
  1226 			HandleBorderEffects()
  1227 		end
  1227 		end
  1242 		if genTimer >= 100 then
  1242 		if genTimer >= 100 then
  1243 
  1243 
  1244 			genTimer = 0
  1244 			genTimer = 0
  1245 
  1245 
  1246 			DrawTag(1)
  1246 			DrawTag(1)
  1247 
       
  1248 			HandleStructures()
       
  1249 
  1247 
  1250 			curWep = GetCurAmmoType()
  1248 			curWep = GetCurAmmoType()
  1251 
  1249 
  1252 			-- change to girder mode on weapon swap
  1250 			-- change to girder mode on weapon swap
  1253 			if (cIndex ~= 1) and (curWep == amGirder) then
  1251 			if (cIndex ~= 1) and (curWep == amGirder) then