share/hedgewars/Data/Scripts/Multiplayer/Construction_Mode.lua
changeset 11732 e28b534188d3
parent 11730 8cc9c8a43dcc
child 11733 67049c8dedd1
equal deleted inserted replaced
11731:d07e749d925d 11732:e28b534188d3
     1 ---------------------------------------------------------
     1 ---------------------------------------------------------
     2 --- LE CONSTRUCTION MODE 0.7 (badly adapted from Hedge Editor 0.5)
     2 --- LE CONSTRUCTION MODE 0.8 (badly adapted from Hedge Editor 0.5)
     3 ---------------------------------------------------------
     3 ---------------------------------------------------------
     4 -- a hedgewars gameplay mode by mikade
     4 -- a hedgewars gameplay mode by mikade
     5 -- special thanks to all who helped test and offered suggestions
     5 -- special thanks to all who helped test and offered suggestions
     6 -- additional thanks to sheepluva/nemo for adding some extra hooks
     6 -- additional thanks to sheepluva/nemo for adding some extra hooks
     7 
     7 
    71 -- cleaned up some of the code a bit and removed about 280 lines of code I didn't need, lol
    71 -- cleaned up some of the code a bit and removed about 280 lines of code I didn't need, lol
    72 
    72 
    73 --v0.6 (dev)
    73 --v0.6 (dev)
    74 -- added magic dance
    74 -- added magic dance
    75 
    75 
    76 --v.07 (pushed to repo)
    76 --v0.7 (pushed to repo)
    77 -- added a cfg file
    77 -- added a cfg file
    78 -- removed another 903 lines of code we weren't using (lol)
    78 -- removed another 903 lines of code we weren't using (lol)
       
    79 
       
    80 --v0.8 (merged in repo)
       
    81 -- applied Wuzzy's patches:
       
    82 --   script parameters: initialenergy, energyperround, maxenergy
       
    83 --   fix crate costs
       
    84 --   various minor tweaks and fixes
       
    85 --   (see commits in official repo)
    79 
    86 
    80 --------------------------------
    87 --------------------------------
    81 -- STRUCTURES LIST / IDEAS
    88 -- STRUCTURES LIST / IDEAS
    82 --------------------------------
    89 --------------------------------
    83 
    90 
   833 					CheckProximity(CurrentHedgehog)
   840 					CheckProximity(CurrentHedgehog)
   834 				end
   841 				end
   835 			end
   842 			end
   836 
   843 
   837 			if strucType[i] == loc("Generator") then
   844 			if strucType[i] == loc("Generator") then
   838 	
   845 
   839 				for z = 0, ClansCount-1 do
   846 				for z = 0, ClansCount-1 do
   840 					if z == strucClan[i] then
   847 					if z == strucClan[i] then
   841 						increaseGearValue(strucGear[i],"power")
   848 						increaseGearValue(strucGear[i],"power")
   842 						if getGearValue(strucGear[i],"power") == 10 then
   849 						if getGearValue(strucGear[i],"power") == 10 then
   843 							setGearValue(strucGear[i],"power",0)
   850 							setGearValue(strucGear[i],"power",0)
   844 							clanPower[z] = clanPower[z] + 1
   851 							clanPower[z] = clanPower[z] + 1
   845 							if conf_maxEnergy ~= "inf" and clanPower[z] > conf_maxEnergy then
   852 							if conf_maxEnergy ~= "inf" and clanPower[z] > conf_maxEnergy then
   846 								clanPower[z] = conf_maxEnergy
   853 								clanPower[z] = conf_maxEnergy
   847 							end
   854 							end
   848 						end
   855 						end
   849 	
   856 
   850 					end
   857 					end
   851 				end
   858 				end
   852 			end
   859 			end
   853 
   860 
   854 		end
   861 		end