share/hedgewars/Data/Scripts/Multiplayer/HedgeEditor.lua
changeset 11992 c3c7c036c521
parent 11991 5a51bca7eeaa
child 11993 b061f4bae002
equal deleted inserted replaced
11991:5a51bca7eeaa 11992:c3c7c036c521
  1847 	--AddTeam(teamname, color, grave, fort, voicepack, flag)
  1847 	--AddTeam(teamname, color, grave, fort, voicepack, flag)
  1848 	--AddHog(hogname, botlevel, health, hat)
  1848 	--AddHog(hogname, botlevel, health, hat)
  1849 
  1849 
  1850 	--this is a quick hack so that the human team(s) will always be
  1850 	--this is a quick hack so that the human team(s) will always be
  1851 	--given the first move ahead of the AI
  1851 	--given the first move ahead of the AI
  1852 	tempDataList = {}
  1852 	local tempDataList = {}
  1853 	if GetHogLevel(gear) == 0 then
  1853 	if GetHogLevel(gear) == 0 then
  1854 		tempDataList = hogDataList
  1854 		tempDataList = hogDataList
  1855 	else
  1855 	else
  1856 		tempDataList = AIHogDataList
  1856 		tempDataList = AIHogDataList
  1857 	end
  1857 	end
  1863 			teamCounter = 1
  1863 			teamCounter = 1
  1864 		end
  1864 		end
  1865 
  1865 
  1866 		-- try match team colour to the colours recorded in the colour array
  1866 		-- try match team colour to the colours recorded in the colour array
  1867 
  1867 
  1868 		tColor = 0x00000000
  1868 		local tColor = 0x00000000
  1869 		for i = 1, #colorArray do
  1869 		for i = 1, #colorArray do
  1870 			if GetClanColor(GetHogClan(gear)) == colorArray[i][1] then
  1870 			if GetClanColor(GetHogClan(gear)) == colorArray[i][1] then
  1871 				tColor = colorArray[i][2]
  1871 				tColor = colorArray[i][2]
  1872 			end
  1872 			end
  1873 		end
  1873 		end
  1954 end
  1954 end
  1955 
  1955 
  1956 -- output hog and team data to the console
  1956 -- output hog and team data to the console
  1957 function SaveHogData()
  1957 function SaveHogData()
  1958 
  1958 
       
  1959 	teamCounter = 0
       
  1960 	lastRecordedTeam = ""
       
  1961 	hhs = {}
       
  1962 	shoppaPointList = {}
       
  1963 	hogDataList = {}
       
  1964 	AIHogDataList = {}
       
  1965 
  1959 	runOnHogs(GetDataForSavingHogs)
  1966 	runOnHogs(GetDataForSavingHogs)
  1960 
  1967 
  1961 	WriteLnToConsole("	------ TEAM LIST ------")
  1968 	WriteLnToConsole("	------ TEAM LIST ------")
  1962 
  1969 
  1963 	for i = 1, #hogDataList do
  1970 	for i = 1, #hogDataList do
  2056 -- sigh
  2063 -- sigh
  2057 -- gradually got more bloated with the addition of hwpoint tracking and
  2064 -- gradually got more bloated with the addition of hwpoint tracking and
  2058 -- distinction betweeen the need to track victory/win conditions or not
  2065 -- distinction betweeen the need to track victory/win conditions or not
  2059 function GetDataForGearSaving(gear)
  2066 function GetDataForGearSaving(gear)
  2060 
  2067 
  2061 	temp = nil
  2068 	local temp = nil
  2062 	specialFlag = nil
  2069 	local specialFlag = nil
  2063 	arrayList = nil
  2070 	local arrayList = nil
  2064 
  2071 
  2065 	if GetGearType(gear) == gtMine then
  2072 	if GetGearType(gear) == gtMine then
  2066 
  2073 
  2067 		if (getGearValue(gear, "tag") ~= nil) then
  2074 		if (getGearValue(gear, "tag") ~= nil) then
  2068 			temp = 	"	tempG = AddGear(" ..
  2075 			temp = 	"	tempG = AddGear(" ..